Area: Ingestion
Sub-Area: Lineage
Applies to: OSS + Cloud
Issue
Table-level lineage shows in DataHub, but column-level lineage (which source columns feed which target columns) is missing.
You Might Be Asking
- How do I enable column-level lineage?
- Why is column lineage missing when table lineage works?
- Do I need
include_usage_statsorinclude_operational_statsfor column lineage? - How do I check whether DataHub can parse my SQL into column lineage?
Cause
Column lineage is already on by default in the main sources, so setting include_column_lineage: true usually changes nothing. You don't need to turn on include_usage_stats or include_operational_stats to get Snowflake column lineage. Column lineage is missing for one of these reasons:
-
Snowflake:
include_column_lineagerequiresinclude_table_lineage. Ifinclude_table_lineageisfalse, the recipe fails with "include_table_lineage must be True for include_column_lineage to be set." Table and column lineage also need the right grants on the ingestion role and Snowflake Enterprise Edition or above. The defaults forinclude_table_lineage,include_column_lineage,use_queries_v2andinclude_usage_statsare alltrue. -
dbt: The recipe needs
manifest_pathandtarget_platform. Neither has a default.catalog_pathis optional. Column lineage needsinfer_dbt_schemasandinclude_column_lineage, and both default totrue. If either is set tofalse, column lineage is off. -
Other sources:
include_column_lineagedefaults totruein Unity Catalog, Trino, Fivetran and Glue. SQLAlchemy-based sources such as Postgres and MySQL defaultinclude_view_column_lineagetotrue. - SQL that DataHub can't parse: DataHub builds column lineage by parsing SQL. If a query fails to parse at the table level, DataHub drops it and it gives no lineage. If only column-level parsing fails, table lineage is kept and column lineage for that query is lost. In online mode DataHub uses table schemas already in DataHub. Offline mode, or tables missing from DataHub, gives less accurate results.
-
Removed keys:
include_view_lineageandinclude_view_column_lineagewere removed from Snowflake in December 2024.include_view_lineage,include_view_column_lineageandlineage_parse_view_ddlwere removed from BigQuery in January 2025. Recipes that still set them log a warning ("Thewas removed on , please remove it from your recipe.") and the key is dropped. View lineage is always ingested when definitions are available. include_view_lineageandinclude_view_column_lineageare still valid for SQLAlchemy sources such as Postgres.
Recipes reject keys a source doesn't define. Use only keys from the source's config reference.
Solution
-
Check the defaults. For Snowflake, make sure
include_table_lineageis not set tofalse. You don't needinclude_usage_statsorinclude_operational_stats. Confirm the role has the grants and the account is on Enterprise Edition or above. See the Snowflake prerequisites and the column-level lineage guide. -
Check the dbt recipe. A minimal recipe looks like this:
source:
type: dbt
config:
manifest_path: "target/manifest.json"
catalog_path: "target/catalog.json"
target_platform: snowflake
catalog_path is optional. Leave infer_dbt_schemas and include_column_lineage at their default of true.
-
Remove removed keys. Delete
include_view_lineageandinclude_view_column_lineagefrom Snowflake recipes. Deleteinclude_view_lineage,include_view_column_lineageandlineage_parse_view_ddlfrom BigQuery recipes. -
Test whether DataHub can parse the SQL. Run this from the CLI:
datahub check sql-lineage --platform snowflake --sql "<your query>"
You can pass --sql-file <file> instead of --sql. Optional flags are --platform-instance, --env, --default-db and --default-schema. Online mode is the default. It uses schemas from DataHub to produce column-level lineage. Use --offline to skip that lookup, but the result is less accurate. In Python, DataHubGraph.parse_sql_lineage(sql, *, platform, platform_instance=None, env=DEFAULT_ENV, default_db=None, default_schema=None, override_dialect=None) returns a SqlParsingResult. See SQL parsing.
If a run still misses lineage, check the ingestion report. A table-level parse failure is counted in num_observed_queries_failed and listed in observed_query_parse_failures. A column-level failure is counted in num_observed_queries_column_failed. Failed view definitions are counted in num_views_failed and listed in views_parse_failures.
-
Add column lineage yourself if parsing can't produce it.
FineGrainedLineageClasstakesupstreamTypeanddownstreamType(both required), plus optionalupstreamsanddownstreamslists of URNs.upstreamTypeisFIELD_SET,DATASETorNONE.downstreamTypeisFIELDorFIELD_SET. WithFIELD_SETupstreams, the lists hold schema field URNs. Build them withmake_schema_field_urn(parent_urn, field_path), where the parent URN starts withurn:li:. WithDATASETupstreams, the list holds dataset URNs.Add the edges as patches. Use
DatasetPatchBuilder(urn).add_fine_grained_upstream_lineage(...), or use the SDK lineage client'sadd_lineage(*, upstream, downstream, column_lineage=False, transformation_text=None). Both build a patch for the downstream dataset. To send a patch, loop overpatch.build()and callgraph.emit(mcp)on each item, wheregraphis aDataHubGraph(DatahubClientConfig(server=..., token=...)). The lineage SDK tutorial has working examples.Prefer patches over writing the whole
upstreamLineageaspect. A connector withincremental_lineageset tofalse(the default for most sources) restates its lineage on each run. If you do emit a full aspect withemit_mcp, pass a singleMetadataChangeProposalWrapper, for exampleemitter.emit_mcp(MetadataChangeProposalWrapper(entityUrn=downstream_urn, aspect=upstream_lineage)). Don't passentity_urn,aspect_nameoraspectkeyword arguments.
Related Documentation
Tags: column-lineage, fine-grained-lineage, sql-parsing, dbt, snowflake, bigquery, field-lineage, transformations