Warehouses

BigQuery

INFORMATION_SCHEMA.JOBS gives every statement, its referenced tables and its output row count.

BigQuery's INFORMATION_SCHEMA.JOBS views are the strongest single source on the platform. Every job carries its statement text, the tables it referenced, the rows it produced and the bytes it processed — which means lineage and reconciliation come from the same query.

referenced_tables in particular is doing work that most platforms require a separate lineage tool for: it is an array of every table the statement read, recorded by the engine rather than parsed from SQL by something that might get it wrong.

What is read

What Decim reads from BigQuery

Every item below is read-only, and each is a specific view, endpoint or file rather than a category of access. If something here is unacceptable in your environment, it can be removed from the query catalogue — see the agent for how that works.

BigQuery — metadata sources
What From Why it matters
Job historyINFORMATION_SCHEMA.JOBS_BY_PROJECTStatement, user, duration, bytes and error result
Referenced tablesjobs.referenced_tablesEngine-recorded read lineage per statement
Output rowsjobs.dml_statisticsInserted, deleted and updated row counts for DML
Table structureINFORMATION_SCHEMA.TABLES, COLUMNSSchema and partitioning
Storage and volumeINFORMATION_SCHEMA.TABLE_STORAGERow count and bytes, near real-time
RoutinesINFORMATION_SCHEMA.ROUTINESStored procedure and UDF bodies
Scheduled queriesData Transfer Service APIRecurring statements and their run history

Permissions required

Written out in full, because "read-only access" is not a specification. Nothing below grants the ability to write, and row access is requested only on the specific tables you name.

IAM roles — read-only bash
# Job metadata across the project, without the ability to run jobs
# on anyone's behalf.
gcloud projects add-iam-policy-binding "$PROJECT" \
  --member="serviceAccount:decim-agent@$PROJECT.iam.gserviceaccount.com" \
  --role="roles/bigquery.resourceViewer"

# Needed to read INFORMATION_SCHEMA at all (runs a query, so it needs
# the ability to execute one and be billed for it).
gcloud projects add-iam-policy-binding "$PROJECT" \
  --member="serviceAccount:decim-agent@$PROJECT.iam.gserviceaccount.com" \
  --role="roles/bigquery.jobUser"

# Metadata on datasets, NOT the data in them.
gcloud projects add-iam-policy-binding "$PROJECT" \
  --member="serviceAccount:decim-agent@$PROJECT.iam.gserviceaccount.com" \
  --role="roles/bigquery.metadataViewer"

# bigquery.dataViewer is granted per-dataset, on reconciliation tables only.

What it builds

What this source contributes to the pipeline topology and to the evidence available during an investigation:

  • Read lineage recorded by the engine rather than parsed from SQL
  • DML row counts per statement — inserted, updated and deleted
  • Scheduled query definitions and their outcomes
  • Near real-time table volumes from TABLE_STORAGE

Nodes learned from a definition are marked declared; nodes observed running are marked observed; nodes both declared and observed are verified. Where two sources disagree, the disagreement is recorded as a drift note rather than resolved silently.

Failure modes

Failure modes it surfaces

What this source is uniquely good at proving — and, just as usefully, at disproving. An investigation that can refute a hypothesis cheaply is worth as much as one that confirms it.

Failure modes BigQuery evidence distinguishes
Failure mode The signal
Query wrote nothingdml_statistics.inserted_row_count at zero
Partition overwrittenA WRITE_TRUNCATE against a partition decorator
Scheduled query silently disabledNo job rows after a date, with no error
Duplicate loadTwo jobs writing the same partition in one window

Limits

What this integration cannot tell you. Stated because an investigation that overstates its sources produces confident wrong answers, which is worse than an honest blocked.

  • JOBS_BY_PROJECT shows only jobs in the current project — cross-project pipelines need reading per project
  • Reading INFORMATION_SCHEMA is itself a billed query, though the volumes involved are trivial
  • referenced_tables covers reads; write targets come from destination_table and DML statistics

Related integrations

  • dbt — manifest.json is the model graph; run_results.json is what actually happened. Both are artefacts, not APIs.
  • Snowflake — ACCOUNT_USAGE gives a year of query, copy and task history — including rows loaded and rows rejected.
  • Fivetran — Sync history and schema change events via API, plus the _fivetran_synced column in every target.
  • ClickHouse — system.query_log carries read_rows and written_rows per statement; system.parts carries real write activity.

See all integrations, or how the sources are combined into one graph.

Get started

Investigating a BigQuery pipeline?

Bring an incident you already know the answer to. If Decim gets it wrong, that is a more useful demo than one where it doesn't.