Data Lineage
Trace where data comes from and where it goes, at table and column level, using dbt, OpenLineage and catalog tools for impact analysis and debugging.
Intermediate · about 3 hours · difficulty 3/5
Learn first: Data Catalogs and Governance, Orchestration Concepts
Lineage is the map of how data flows: this dashboard reads this mart, which is built from these staging models, which come from these source tables. It turns "the number looks wrong" into a focused investigation.
Why lineage matters
- Impact analysis: before changing or dropping a column, see every downstream model and dashboard affected.
- Root cause analysis: trace a bad number upstream to the failing source.
- Compliance: show where personal data flows, which privacy laws require.
- Cleanup: find unused tables nobody depends on.
Levels of lineage
- Table-level: which tables feed which.
- Column-level: which source columns produce a given output column. Harder but much more useful for PII tracking.
- Job-level: which runs produced which data versions.
How lineage is collected
- Parsing SQL (dbt builds lineage from ref and source; tools parse warehouse query logs).
- Runtime events: OpenLineage is an open standard; Airflow, Spark, dbt and Flink integrations emit lineage events to a backend such as Marquez or a catalog.
- Platform-native lineage in Unity Catalog, BigQuery and Dataplex, and Snowflake.
Pitfalls
- Lineage gaps from custom scripts that bypass instrumented tools.
- Trusting table-level lineage for PII questions that need column-level detail.
You are ready to move on when you can show the lineage graph of your project from source to dashboard, and use it to list everything affected if you renamed one source column.
Key concepts
- Impact analysis
- Root cause tracing
- Table vs column lineage
- OpenLineage standard
- Marquez
- Lineage in dbt docs
Mini project
Enable OpenLineage in your Airflow or Spark setup and send events to Marquez (Docker), or use your catalog's lineage view. Produce a lineage diagram from source to a final mart and write an impact analysis for renaming one column.
Check yourself
Why is column-level lineage needed to answer 'where does customer phone number data end up?'
Free resources
- OpenLineage (OpenLineage)
- dbt documentation (dbt Labs)
- DataHub documentation (DataHub)