All posts
7 min read · 2026-04-21

How to trace column lineage in Snowflake

snowflake
lineage

Snowflake's ACCOUNT_USAGE.OBJECT_DEPENDENCIES tells you that a view depends on a table. It does not tell you which column of the view depends on which column of the table. For data debugging, that gap is usually the whole problem.

Option 1: GET_OBJECT_REFERENCES

Useful for object-level dependency walks, but it stops at the object boundary. You still cannot answer 'where does mart.revenue come from?' in one query.

Option 2: Parse the DDL yourself

Pull DDL with GET_DDL and feed it through a SQL parser that understands Snowflake. This works, but writing a Snowflake parser that handles VARIANT casts, MERGE statements, streams, and tasks is a project in itself.

Option 3: Use a visual lineage tool

Paste your Snowflake DDL into a column-level lineage tool like SQLise and click the column you care about. The graph shows you, edge by edge, exactly which raw columns feed it — including across stages, streams, and tasks.

If you only need lineage for a one-off debugging session, you don't need to install anything. Paste the DDL into the playground and click the column.
raw_app.users.emailstg_users.emailint_user_activity.emailmart_active_users.email
Snowflake column-level lineage: raw_app.users.email → stg → int → mart_active_users.email.

Worked example

See the dbt staging model example for an end-to-end Snowflake lineage walkthrough from raw_app.users → analytics.mart_active_users.

Try it on your own SQL: