Data Lineage
Data lineage is a record of where each table and column comes from, which jobs transform it, and what reads it downstream.
What Is Data Lineage?
Data lineage follows each table and column from the source database through the warehouse to the dashboards and syncs that read it. Engineers use it to trace a wrong number back to where it came from, and to see what a schema change will break before it ships.
Lineage is stored as a directed graph:
- Nodes: tables, models, and dashboards, or the columns inside them.
- Edges: the job or query that reads one node and writes another.
- Edge metadata: when the job ran, which code version ran, and how each output column was derived.
Lineage is usually kept next to a data catalog, which lists what exists, and data classification, which marks what's sensitive.
How Data Lineage Works
Data lineage tools build the graph from three sources:
- Query logs: warehouses record which objects each query read and wrote. Snowflake's
ACCESS_HISTORYview (Enterprise Edition) adds column lineage for writes such asINSERT,MERGE, andCREATE TABLE AS SELECT. Google Cloud's Knowledge Catalog collects BigQuery lineage automatically once lineage is enabled for the project, and Unity Catalog captures lineage for Databricks queries down to the column. - Static SQL parsing: dbt builds its DAG from
ref()andsource()calls and derives column lineage by parsing compiled SQL. - Runtime events: jobs instrumented with OpenLineage, such as Airflow tasks and Spark applications, emit run events that name their input and output datasets.
Query logs only see what happens inside the warehouse. The step from the production database into the warehouse shows up only if the ingestion tool reports it.
Example: a column rename in Postgres
One rename in Postgres, followed through to a dashboard:
- An engineer runs
ALTER TABLE customers RENAME COLUMN email TO email_address;in Postgres. - Logical decoding doesn't emit DDL. Before the next row change on
customers, thepgoutputplugin sends a Relation message with the new column list, so the change data capture pipeline seesemaildisappear andemail_addressappear (how a rename reaches the warehouse). - In Snowflake, the rename lands as a new column. The old
emailcolumn either stops receiving values or is dropped, depending on pipeline settings. - The dbt model
stg_customersstill selectsemail. If the column was kept, the model returns nulls for new rows without failing. If it was dropped, the dbt run fails. dim_customers, a Looker dashboard of signups by domain, and a reverse ETL sync to the CRM all read fromstg_customers.
Column-level lineage that starts at customers.email shows steps 3 to 5 before anyone runs the ALTER. Lineage built only from warehouse logs starts at step 3, so nothing links the broken dashboard back to the rename.
Column-Level vs Table-Level Lineage
Table-level lineage links whole tables, while column-level lineage links each output column to the input columns it was computed from. Table-level lineage shows that dim_customers depends on customers. Column-level lineage shows that dim_customers.email_domain depends on customers.email alone, so a change to customers.phone leaves it untouched.
| Dimension | Table-level | Column-level |
|---|---|---|
| Edge | Table to table | Column to column, with transformation type |
| Built from | Query logs, dbt DAG, pipeline config | Parsed SQL, query logs with column detail |
| Change impact | Every downstream table, with many false positives | Only assets that read the changed column |
| Gaps | Misses which columns a job actually uses | Python models and complex lateral joins in dbt, UDFs in Unity Catalog |
| Availability | Included in most tools | Paid tiers in some: dbt Catalog on Enterprise plans, Snowflake Enterprise Edition |
The OpenLineage column lineage facet separates direct edges, where the output value is derived from the input, from indirect edges, where the input only joins, filters, groups, or sorts the rows. In WHERE status = 'active', status is an indirect dependency of every output column: changing it changes the result even though no value is copied.
Table-level lineage is enough to know who owns a table and what goes stale when a load fails. Impact analysis for a schema change, or carrying sensitivity labels downstream, takes column-level lineage.
What a Data Lineage Tool Needs to Show
Data lineage tools help in an incident or before a schema change only if the graph covers the whole path and stays current. It should show:
- The source column: the production database, schema, table, and column, in addition to the replicated warehouse copy.
- The pipeline: which replication or ingestion job carries the table, and its current lag.
- Column edges with transformation type: direct and indirect, so a filter column isn't missed.
- Consumers past the warehouse: BI dashboards, reverse ETL syncs, ML features, and AI agents that query tables.
- Schema change history: when a column was added, renamed, or retyped, with the before and after definitions.
AI agents that write SQL need the same catalog entries, classification labels, and lineage before they query a table. Lineage won't catch bad values, though. That takes checks such as validation inside the pipeline.
Data Lineage and Data Classification
Data classification labels sensitive columns, and lineage carries those labels to every copy and derivative. A Postgres column tagged as PII stays PII after replication, a dbt rename, and a join into a mart. Without column-level edges, the label stays on the source table and the mart looks clean.
- Label propagation: a direct edge from a PII column passes the label downstream. An indirect edge usually doesn't, since a filter on
emailcopies none of its values. - Masking: OpenLineage records a
maskingflag on each transformation, so a hashed column can carry a weaker label than the raw one. - Erasure requests: a GDPR deletion has to reach every table that holds a person's data. Lineage from the source column gives you that list of tables.
How Artie handles this
Each Artie pipeline maps a source table to a destination table, so its lineage starts at the production table. Every weekday morning by default, Artie checks the source databases of running pipelines for added, removed, and altered columns, and logs each change with its before and after state. Artie's Data Catalog picks up at the destination table. It reads dbt builds and the warehouse's query history to link columns on Snowflake and Databricks, and whole tables on ClickHouse, BigQuery, and Redshift. Snowflake lineage needs Enterprise Edition and the SNOWFLAKE.GOVERNANCE_VIEWER role. Column links on Databricks need access to the column lineage system table. BI dashboards and reverse ETL syncs still need a tool such as DataHub or OpenMetadata.
Frequently asked questions
What is data lineage?
Data lineage is the record of where data comes from and where it goes: which source tables and columns feed each warehouse table, which jobs transform them, and which dashboards and syncs read the result. It's built from query logs, parsed SQL, and pipeline metadata. Engineers use it to debug wrong numbers and to review changes before they ship.
What is column-level lineage?
Column-level lineage traces each output column to the specific input columns that produced it, instead of linking whole tables. It shows that dim_customers.email_domain comes from customers.email, so a change to that one source column flags only the assets that read it. Most tools derive it by parsing SQL.
Does dbt lineage cover the whole pipeline?
dbt lineage covers models and the sources they declare, from raw warehouse tables to marts and exposures. It doesn't see the production database or the ingestion pipeline that loads the raw tables. As of November 2026, column-level lineage in dbt Catalog requires an Enterprise or Enterprise+ plan, and it can't trace through Python models.
Can a schema change in the source database break lineage?
A schema change in the source database can break both the pipeline and the lineage graph. A Postgres rename reaches the warehouse as a new column, so parsed lineage keeps pointing at the old name until the models change. Catching it means detecting the change at the source and following that column's lineage downstream.