Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing
Back
  1. Home
  2. Interview prep
  3. Lineage in dbt

dbt · Extra High-Value

Lineage in dbt

Mediumdbt-37
lineagedocsimpact analysisref

Question

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

Solution

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
raw.orders
    → stg_orders
        → int_orders_enriched
            → fct_orders
                → exposure: revenue_dashboard

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."

PreviousNext