dbt · Extra High-Value

Lineage in dbt

Mediumlineagedocsimpact analysisref

Interview question

How does lineage work in dbt, and why do interviewers care?

How to answer

The short answer

Lineage is the map of how data flows: sources → staging → intermediate → marts → exposures. In dbt it comes from source(), ref(), tests, and exposure dependencies.

Where you see it

  • dbt docs lineage graph
  • Manifest artifacts used by CI and catalog tools
  • Selectors (+model+) that walk ancestors/descendants

Why it matters operationally

  • Impact analysis before changing a column
  • Debugging "why is this dashboard wrong?" by walking upstream
  • Selective builds/tests in CI based on changed nodes
  • Trust: stakeholders see where a metric comes from

What lineage is not

dbt lineage is project-level (declared in code). It is not a full enterprise data-catalog crawler unless you export the manifest/catalog into one.

Interview tip: "I always ref/source instead of hardcoding tables so lineage and selectors stay accurate."