Warehouses

Snowflake

ACCOUNT_USAGE gives a year of query, copy and task history — including rows loaded and rows rejected.

Snowflake has the best retrospective metadata of any platform here. SNOWFLAKE.ACCOUNT_USAGE retains up to 365 days of query history, copy history and task history, which means an investigation into something that happened three months ago is actually possible — a sentence that is false almost everywhere else.

COPY_HISTORY is the standout for ETL specifically: it records ROW_COUNT, ROW_PARSED and ERROR_COUNT per file per load, which is a file-level reconciliation recorded automatically.

What is read

What Decim reads from Snowflake

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.

Snowflake — metadata sources
What From Why it matters
Query historyACCOUNT_USAGE.QUERY_HISTORYStatement text, duration, rows produced, warehouse and user
Load historyACCOUNT_USAGE.COPY_HISTORYPer-file rows parsed, loaded and errored
Task runsACCOUNT_USAGE.TASK_HISTORYScheduled task outcomes and their dependency graph
Object accessACCOUNT_USAGE.ACCESS_HISTORYWhich query read and wrote which object — lineage
Table metadataACCOUNT_USAGE.TABLESRow counts and bytes, refreshed periodically
Pipe activityACCOUNT_USAGE.PIPE_USAGE_HISTORYSnowpipe ingestion volumes
Dynamic tablesINFORMATION_SCHEMA.DYNAMIC_TABLE_REFRESH_HISTORYRefresh outcomes and lag

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.

Read-only role sql
CREATE ROLE decim_agent;

-- ACCOUNT_USAGE is the shared database of account metadata.
GRANT IMPORTED PRIVILEGES ON DATABASE SNOWFLAKE TO ROLE decim_agent;

-- A small warehouse for the agent's own queries, so its usage is
-- attributable and separately capped.
CREATE WAREHOUSE decim_wh WITH WAREHOUSE_SIZE = 'XSMALL'
  AUTO_SUSPEND = 60 AUTO_RESUME = TRUE;
GRANT USAGE ON WAREHOUSE decim_wh TO ROLE decim_agent;

-- Reconciliation tables only.
GRANT USAGE  ON DATABASE sales           TO ROLE decim_agent;
GRANT USAGE  ON SCHEMA   sales.public    TO ROLE decim_agent;
GRANT SELECT ON TABLE    sales.public.rejected_transactions TO ROLE decim_agent;

CREATE USER decim_agent DEFAULT_ROLE = decim_agent
  DEFAULT_WAREHOUSE = decim_wh;
GRANT ROLE decim_agent TO USER decim_agent;

What it builds

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

  • Object-level lineage from ACCESS_HISTORY, covering ad-hoc work as well as scheduled
  • File-level load reconciliation from COPY_HISTORY
  • Task dependency graphs and their run outcomes
  • Up to a year of history, which makes slow-burn investigations viable

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 Snowflake evidence distinguishes
Failure mode The signal
Rows rejected during loadERROR_COUNT non-zero with ON_ERROR = CONTINUE
File loaded twiceSame file name appearing twice in COPY_HISTORY
Task chain stoppedA root task suspended, so no downstream task runs
Ad-hoc write to productionACCESS_HISTORY write with no corresponding task

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.

  • ACCOUNT_USAGE.TABLES.ROW_COUNT is refreshed periodically and is not transactionally accurate
  • ACCESS_HISTORY requires Enterprise Edition or above
  • The agent's own queries consume credits — hence the separate, small, auto-suspending warehouse

Related integrations

  • dbt — manifest.json is the model graph; run_results.json is what actually happened. Both are artefacts, not APIs.
  • Fivetran — Sync history and schema change events via API, plus the _fivetran_synced column in every target.
  • BigQuery — INFORMATION_SCHEMA.JOBS gives every statement, its referenced tables and its output row count.
  • 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 Snowflake 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.