Column-level lineage: what it is, why table-level isn't enough, and how to actually get it
A practical guide to the four approaches (AST, static analysis, runtime capture, manual) and which one fits which team.
If you have a dbt project or a data catalog, you already have table-level lineage. The dbt exposure DAG, DataHub’s default view, Atlan’s lineage tab, OpenMetadata - they all show you the same thing: orders feeds stg_orders, which feeds monthly_revenue, which feeds three dashboards. Boxes and arrows. Useful for onboarding and change reviews, and the industry has largely converged on it as table stakes.
Every vendor pitch you sit through now, though, mentions column-level lineage. Atlan sells it as an upgrade tier. DataHub ships it in the open-source build. Monte Carlo, Metaplane, and the newer observability tools include it in their default trace view. dbt Labs added it to their Semantic Layer, Databricks ships it in Unity Catalog, Snowflake exposes it through ACCESS_HISTORY. The obvious question, if you already have table-level working, is whether the extra investment is worth it - and if you conclude it is, which of the four common ways to build it actually fits your stack.
This post walks through the concrete difference (with a query), the four questions where column-level actually earns its build cost, the four implementation approaches (AST, static analysis, runtime capture, manual), a comparison table, the failure mode each approach hits in production, and a short decision guide for picking one - or, more commonly, picking two.
The concrete difference
Take a genuinely small warehouse query. Not a strawman - the kind of thing your team ships in a Monday PR:
CREATE TABLE monthly_revenue AS
SELECT
date_trunc('month', orders.created_at) AS month,
orders.plan_id AS plan,
SUM(orders.amount * orders.plan_multiplier) AS arr,
COUNT(DISTINCT orders.customer_id) AS paying_customers
FROM orders
LEFT JOIN plans ON plans.id = orders.plan_id
WHERE orders.status = 'active'
GROUP BY 1, 2;
Table-level lineage renders this as one edge: orders -> monthly_revenue, plus plans -> monthly_revenue if the tool notices the join. That is genuinely useful. It answers “if I break orders, what breaks downstream?”
Column-level lineage renders the same query as a graph of six edges:
monthly_revenue.month<-orders.created_atmonthly_revenue.plan<-orders.plan_idmonthly_revenue.arr<-orders.amount,orders.plan_multipliermonthly_revenue.paying_customers<-orders.customer_id- (filter dependency)
monthly_revenue.*<-orders.status - (join dependency)
monthly_revenue.*<-plans.id
The graph you get from column-level answers a strictly different set of questions than the graph you get from table-level, and if the questions listed below are ones your team asks, the extra graph pays for itself.
Two things worth noticing in the column-level version. First, the arithmetic in the SUM is preserved as a multi-source edge: arr genuinely comes from two columns, and any tool that flattens that to one loses the audit story. Second, the filter (orders.status = 'active') and the join key (plans.id) show up as dependencies even though they never appear in the output row. A column-level tool that ignores filter and join dependencies is a table-level tool with more boxes drawn on it.
When table-level is genuinely enough
Not every team needs column-level. A few honest cases where the extra precision does not earn its keep:
- Small team, single BI tool, one dbt project. If the same three analysts wrote every model and every dashboard, they already know which column feeds which chart. The extra graph is decoration.
- Low blast-radius schema changes. If you rename
orders.amountand nothing downstream references it in code you cannot search,grepplus a dbt build is faster than a lineage crawl. - No compliance pressure. If no auditor is going to ask you which downstream systems consume the SSN column, table-level is fine.
- You are not deprecating metrics yet. Teams that have not yet accumulated dead metrics in Looker or Superset can shortcut this with a spreadsheet.
The teams for whom table-level is enough almost all have the same shape: fewer than ten dbt models, one BI tool, and a technical founder or lead who remembers the schema. Anything past that scale hits column-level questions within a quarter, and the honest signal that you have crossed the line is when a schema-change PR gets reviewed with the reviewer asking “which dashboards use this column?” and the answer is a shrug plus a grep of the Looker or Superset git repo. That is the moment table-level lineage is not enough anymore.
When you actually need column-level
Four questions I hear from data engineers where table-level cannot help and column-level can:
PII compliance. GDPR Article 30 asks you to name the systems that process each category of personal data. Table-level says “the dashboards table depends on users”. Column-level says “the weekly_engagement dashboard reads users.email at position 3 of a SELECT, but the revenue_by_cohort dashboard reads only users.cohort_id.” When your DPO asks which dashboards touch users.ssn, table-level gives you a list of everything downstream of users (usually most of the warehouse). Column-level gives you the right answer. The same shape of question drives HIPAA covered-entity audits, CCPA data-subject deletion requests (“prove users.email was purged from all downstream marts”), and SOC 2 access reviews. In every one of those regimes, “we depend on the users table” is not an audit-passable answer.
Schema change impact. You are about to rename orders.amount to orders.gross_amount. Table-level tells you monthly_revenue, daily_revenue, and customer_ltv depend on orders. Column-level tells you exactly which of those actually reference amount - typically three or four, versus the twenty-odd that reference orders for anything. The difference between “review 3 PRs” and “review 20 PRs” is the difference between shipping and slipping the change.
Metric drift audit. Two dashboards both report arr. Do they compute it from the same upstream column with the same arithmetic? Table-level says they both depend on orders - unhelpful. Column-level shows one derives from orders.amount * plans.multiplier and the other from orders.gross_amount alone. That is the exact shape of the drift.
Metric deprecation. You want to retire orders.legacy_amount. Table-level tells you which tables reference orders. Column-level tells you which specific dashboards, notebooks, and downstream tables reference legacy_amount versus amount. The delete becomes safe instead of scary. A related shape: you want to retire dim_customers_v1 in favour of dim_customers_v2. Column-level tells you which fields in the old model have a one-to-one migration target and which do not - the ones that do not are the migration blockers, and having that list before you start is the difference between a two-week migration and a two-quarter one.
If two or more of those questions ring true, you need column-level lineage. If none of them do, save the build.
The four approaches
There are four common ways to actually compute column-level lineage. Each has a real strength and a specific failure mode.
1. AST-based
Parse the SQL into an abstract syntax tree, resolve column references, walk the tree. When a SELECT expression is SUM(orders.amount * orders.plan_multiplier) AS arr, the AST tells you unambiguously that arr derives from amount and plan_multiplier. Open-source sqlglot has become the default library for this, and dbt Labs’ Semantic Layer, Google’s Malloy, and Cube.dev all use AST-walkers over compiled SQL for their internal lineage.
# Rough shape of an sqlglot lineage call. Public docs example.
import sqlglot
from sqlglot import lineage
sql = "SELECT SUM(amount * plan_multiplier) AS arr FROM orders"
graph = lineage.lineage("arr", sql, dialect="clickhouse")
# graph.source columns: {"orders.amount", "orders.plan_multiplier"}
Strength: precise, deterministic, and works on definitions that have never been queried. Runs at build time, produces a stable graph committed to source control alongside the models, and is diff-able in PR review.
Weakness: dialect quirks (Snowflake QUALIFY, ClickHouse ARRAY JOIN, BigQuery UNNEST), UDFs whose bodies the parser cannot see, and dynamic SQL assembled from strings. A team that leans heavily on Jinja-templated {{ ref() }} calls or stored procedures with EXECUTE IMMEDIATE will find edges silently missing. sqlglot’s dialect coverage is unusually wide (twenty-plus dialects at the time of writing) but every dialect has an edge that is only partially supported, and the safe posture is a regression test suite that pins the expected lineage for your top-N models.
2. Static analysis
Read the SQL as text, apply heuristics, and look up column names against a catalog. This is what older DataHub column-level lineage did before the sqlglot integration, and what most homegrown “grep the git repo” implementations end up being. It scales cheaply, and it catches obvious references without needing a full parser.
Strength: no execution needed, tolerant of partial catalogs, runs anywhere.
Weakness: false positives on aliases and subqueries. A query like SELECT o.amount FROM orders o looks unambiguous, but nested subqueries with aliased column pass-throughs (SELECT a AS b FROM (SELECT amount AS a FROM orders)) are where regex-based approaches quietly fail. SELECT * is a special horror - the static analyzer has to guess which columns are actually consumed downstream.
3. Runtime capture
Instrument the query engine to emit lineage events per executed query. Every time a query runs, the engine reports “this output column came from these input columns.” OpenLineage (an LF AI & Data project under the Linux Foundation) defines the event schema. Snowflake ships this natively as SNOWFLAKE.ACCOUNT_USAGE.ACCESS_HISTORY with column-level joins. Databricks’ Unity Catalog captures the same. Google BigQuery exposes it via Dataplex lineage.
The event shape is standardized. OpenLineage’s columnLineage facet, from the public spec, attaches to an output dataset and looks like this on the wire:
{
"outputs": [
{
"namespace": "warehouse",
"name": "monthly_revenue",
"facets": {
"columnLineage": {
"fields": {
"arr": {
"inputFields": [
{"namespace": "warehouse", "name": "orders", "field": "amount"},
{"namespace": "warehouse", "name": "orders", "field": "plan_multiplier"}
],
"transformationDescription": "SUM(amount * plan_multiplier)",
"transformationType": "AGGREGATION"
}
}
}
}
}
]
}
Every executed query emits one of these into your OpenLineage backend (Marquez, DataHub’s ingestion, Astronomer’s lineage store). The catalog then reconstructs the graph. It is the industry-standard event schema, adopted by Airflow, dbt, Spark, and Flink.
Strength: ground truth. If the engine executed the query, the reported lineage is exactly what the query did. No parser disagreement, no dialect drift.
Weakness: it only captures what actually ran. A dbt model that is defined but has never been materialized will not appear. A dashboard that a user has not opened in six months will not appear. Runtime capture is a lagging view of your warehouse, not a definition view. It also incurs real cost - Snowflake’s ACCESS_HISTORY retention is per your account edition, and OpenLineage volumes at a busy warehouse can produce millions of events per day that some backend has to store and index.
4. Manual explicit
The lineage is the schema. LookML’s explore blocks force you to declare joins: explicitly and reference columns by name. Cube.dev’s YAML schema forces the same. When the schema is the lineage, there is nothing to compute.
Strength: precise and human-verified. The reviewer of the PR that added the field also declared its dependency, so the lineage is exactly as trustworthy as the code review that shipped it.
Weakness: drift. The engineer who ships a new dashboard next quarter forgets to update the LookML explore. Six months in, a chunk of your BI is off-model and your lineage graph does not know it. Teams that succeed with the manual approach almost always pair it with a linter that fails CI when a query references a field not declared in the schema - Cube’s dry-run mode and LookML’s content_validator are the mechanisms of choice.
Comparison at a glance
| Approach | Precision on standard SQL | Dialect support | Dynamic SQL | Catches unused columns | Update cost |
|---|---|---|---|---|---|
| AST-based | High | Depends on parser | Poor | Yes (build-time) | Automatic on build |
| Static analysis | Medium | Broad, shallow | Medium | Yes (source-scan) | Automatic, but noisy |
| Runtime capture | Very high (what ran) | Native to warehouse | Excellent | No | Zero (streams from engine) |
| Manual explicit | Very high | N/A | N/A | Yes | High (humans keep it fresh) |
The important read from that table: no single approach is dominant. AST-based and runtime capture are complementary, not substitutes. AST covers definitions that have not been queried yet; runtime captures dynamic SQL that no parser can resolve. Teams with governance obligations often end up running both.
What breaks each approach
The failure modes are more interesting than the strengths, because they are the reason vendor demos always look better than the production result.
AST-based breaks on complex CTEs with self-joins where the parser has to guess which side of the join a column came from, and on UDFs whose bodies are opaque to the parser. It also breaks on any dialect-specific syntax the parser has not caught up with - sqlglot’s ClickHouse coverage is good but not complete, and edge cases in ARRAY JOIN or LATERAL VIEW will silently drop lineage edges. Symptom: the graph looks clean, but a spot-check reveals missing edges you know should be there.
Static analysis breaks the moment somebody writes SELECT *. The analyzer has no way to know which columns the downstream consumer actually reads, so it either records every column from the source (over-reporting drift) or records none (under-reporting impact). It also produces confident-looking false positives when a query uses table aliases the analyzer misresolves - SELECT o.amount FROM orders o JOIN order_events o ON … is exactly the kind of shadowed alias that a heuristic misses and a parser does not. Symptom: the graph is dense and mostly right, but the wrong edges surface loudly whenever somebody investigates a specific column, and trust in the graph erodes fast.
Runtime capture breaks on the definition-versus-execution gap. You just shipped a new monthly_revenue_v2 model in dbt but no dashboard queries it yet. Runtime capture reports no lineage. Your governance review sees a table with no downstream consumers and marks it safe to modify. Six weeks later a dashboard picks it up and the change breaks it. Symptom: coverage looks great for hot paths and empty for anything new.
Manual explicit breaks the day a new hire ships a Looker dashboard without touching the LookML explores, or an analyst writes a Cube.dev query that references a column not declared in the schema. Symptom: the lineage graph looks pristine, but everybody senior knows to distrust it because “the LookML has not been updated in months.”
Which fits which team
A practical decision guide, based on the shape of your stack:
- dbt-native team on one warehouse. AST-based lineage over compiled SQL is the natural fit. Either take dbt Labs’ Semantic Layer, which ships column-level lineage, or wire sqlglot against your compiled
target/directory. Runs at build time. Zero runtime cost. - Warehouse-native team (Snowflake / Databricks / BigQuery). Turn on the built-in
ACCESS_HISTORY, Unity Catalog, or Dataplex lineage. It is free with the warehouse and it is the highest-quality data you will get. Do not build a competing system on top of a warehouse that ships this natively. - Multi-tool BI stack with governance pressure. Runtime capture via OpenLineage into a catalog (DataHub, OpenMetadata, or Atlan) is the only approach that spans engines. It is expensive to wire up but it is the only lineage that survives a Tableau workbook, a Metabase question, and a Jupyter notebook coexisting.
- Small LookML or Cube shop. Manual and explicit is cheaper than the automation. Enforce it in code review, sample-audit twice a year, and skip the tooling.
- Team migrating warehouses. Runtime capture on the source warehouse plus AST at the destination is the safest posture during a migration. The source tells you what actually runs today (so you can size the migration), the destination tells you what your compiled models will do (so you can validate parity).
The failure mode most teams hit is picking one approach and expecting it to answer every column-level question. It will not. AST does not know about SELECT *. Runtime does not know about the dbt model you shipped yesterday. Static analysis does not know about that CTE with the self-join. The teams that get column-level lineage to actually work in production almost always run two: an AST-based build-time graph as the definitional source of truth, plus warehouse-native runtime capture as the execution source of truth, and they treat divergence between the two as its own alert.
A concrete example of that divergence being useful: your build-time AST graph says monthly_revenue.arr derives from orders.amount and orders.plan_multiplier. Your runtime capture, over the last thirty days, reports arr was actually resolved from orders.gross_amount and orders.plan_multiplier. Somebody changed the model in code without changing the compiled artifact - or the reverse. Either way, that gap is a real bug and it is exactly the kind of thing neither approach catches alone.
A note on cost
The build cost of column-level lineage is not just the tooling. It is also the operational cost of a graph that your engineers now trust and act on. Once a schema-change PR gets reviewed against the column-level graph, you are committed to keeping the graph fresh, and stale lineage that nobody trusts is worse than no lineage at all. Budget the on-call cost of keeping the pipeline green - runtime capture backends need retention tuning, AST parsers need dialect updates as your warehouse team enables new syntax, and manual schemas need code-review discipline. Every team I have seen ship column-level lineage successfully treats it as a small persistent product surface, not a one-time integration.
Closing
If you are sitting between the AST-based and runtime-capture worlds - a dbt-shaped semantic model on a multi-tool BI stack - Goni ships a build-time column-level lineage graph as a first-class output of every semantic build, so definitions that exist but have not been queried yet still appear. It is one option worth evaluating for that hybrid case. See goni.paysera.com.