Area: Ingestion Issues
Sub-Area: Lineage Resolution (Snowflake, dbt, Looker/LookML)
Applies to: OSS + Cloud
Issue
Lineage is missing between Snowflake, dbt and Looker/LookML assets in DataHub. Common symptoms:
- A LookML view has no upstream Snowflake table, often when the view uses a derived table.
- A Snowflake table that dbt does not manage has no upstream lineage.
- dbt models and Snowflake tables with the same names do not link up.
DataHub connects lineage across sources by matching dataset URNs exactly. If two sources write the same table with different casing (DWH_PROD.SALES.ORDERS and dwh_prod.sales.orders), DataHub stores two separate datasets, and the lineage edge points at the one you are not looking at.
Error Messages
- Snowflake ingestion warning when
convert_urns_to_lowercaseisfalse:Please useconvert_urns_to_lowercase: True, otherwise lineage to other sources may not work correctly. - LookML ingestion warning:
Failed to load connection. Check your API key permissions and/or connection_to_platform_map configuration. - LookML ingestion log line:
Failed to retrieve connection <name> from Looker. This usually happens when the credentials provided are not admin credentials. - LookML recipe validation error:
API credential was not found. LookML source requires api credentials ... - Banner on a dataset page:
This entity is not discoverable via search or lineage graph. Contact your DataHub admin for more information.DataHub shows this banner on a soft-deleted entity. It appears on old datasets that stateful ingestion removed after their URN changed.
You Might Be Asking
- Why does my Snowflake table show no upstream lineage even though it exists in DataHub?
- Why does my LookML view have no upstream lineage when the source table is clearly defined?
- Why does lineage break between dbt and Snowflake assets when the table names look the same?
- Does casing in database or schema names affect lineage in DataHub?
- What Looker API settings do I need for derived table lineage in LookML?
Solution
Each of the causes below can break lineage on its own. Check all of them.
- Keep URN casing the same across Snowflake, dbt and LookML
The Snowflake and dbt sources both have convert_urns_to_lowercase, and it defaults to true in both. See the config details in the Snowflake source docs and the dbt source docs. The LookML source has no such option. It always lowercases the database, schema and table names it writes into upstream URNs. So with default settings, all three sources produce lowercase URNs and match.
Casing breaks lineage only when a Snowflake or dbt recipe sets convert_urns_to_lowercase: false. Look for that line in your recipes. Do not add convert_urns_to_lowercase to a Looker or LookML recipe. Those sources reject unknown keys, so the recipe fails validation.
A dbt recipe must also set target_platform. It has no default, and dbt uses it to build the Snowflake URNs it links to:
source:
type: dbt
config:
manifest_path: "<path-to-manifest.json>"
catalog_path: "<path-to-catalog.json>"
target_platform: snowflake
Caution: convert_urns_to_lowercase is part of every dataset URN. If you change it on a source that already ran, each dataset from that source gets a new URN (DWH_PROD.SALES.ORDERS becomes dwh_prod.sales.orders). With stateful ingestion, the next run soft deletes the old datasets as stale. If more than fail_safe_threshold percent (75 by default) of the last run's URNs changed, the fail-safe blocks this. The run then soft deletes nothing, reports a failure, and you get duplicates. Without stateful ingestion, you also get duplicates. Documentation, tags, owners and glossary terms added in the UI stay on the old datasets. Plan how to move them before you switch.
- Grant Snowflake access to lineage history
For Snowflake tables that dbt does not manage, the Snowflake source reads table-to-table lineage from snowflake.account_usage.access_history. This needs:
- Snowflake Enterprise Edition or above.
-
include_table_lineageleft at its default oftrue. - The
IMPORTED PRIVILEGESgrant on theSNOWFLAKEdatabase for the DataHub role:
GRANT IMPORTED PRIVILEGES ON DATABASE SNOWFLAKE TO ROLE <datahub_ingestion_role>;
Without this grant, lineage, usage and tags do not work, and the ingestion logs show permission errors. See the prerequisites in the Snowflake source docs.
- Use the Looker API for LookML view lineage
With use_api_for_view_lineage: true, the LookML source asks the Looker API for the fully rendered SQL of each view and parses that. This gives more accurate lineage than parsing the LookML files, and helps most with derived tables. It needs an api block. Without one, the recipe fails validation with API credential was not found. Use a Looker API key with Admin privileges.
source:
type: lookml
config:
base_folder: "<path-to-lookml-repo>"
api:
base_url: "https://<your-instance>.cloud.looker.com"
client_id: "${LOOKER_CLIENT_ID}"
client_secret: "${LOOKER_CLIENT_SECRET}"
use_api_for_view_lineage: true
use_api_cache_for_view_lineage: true
Use git_info in place of base_folder if DataHub checks the repo out from Git.
With an admin API key, you do not need connection_to_platform_map. The source reads each Looker connection's platform, database and schema from the Looker API. Add the map if your API key is not an admin key (then also set project_name), if you can't use the API at all, or if you need to set platform_instance or platform_env for a connection. Each map entry uses platform and default_db, with optional default_schema, platform_instance and platform_env:
connection_to_platform_map:
"<looker-connection-name>":
platform: snowflake
default_db: "<your-database>"
default_schema: "<your-schema>"
project_name: "<your-looker-project>"
API-based lineage works only for views that at least one explore references. Views that no explore references fall back to file parsing. With emit_reachable_views_only: true (the default), the source skips them. See the lookml module in the Looker source docs, under Setup your connection mapping.
- Fix the "Failed to load connection" warning
If the LookML ingestion report shows Failed to load connection. Check your API key permissions and/or connection_to_platform_map configuration., the source could not resolve a model's Looker connection. It skips every model that uses that connection, so those views get no upstream lineage. The warning context names the connection (Connection: <name>).
The connection lookup through the Looker API needs an API key with Admin privileges. With a non-admin key, the lookup fails and the log shows Failed to retrieve connection <name> from Looker. This usually happens when the credentials provided are not admin credentials. Fix it one of two ways:
- Use a Looker API key with Admin privileges in the
apiblock. - Add an entry for that connection to
connection_to_platform_mapand setproject_name, as shown in step 3.
Both options are described under Setup your connection mapping in the lookml module of the Looker source docs. The permission list under Set up the right permissions on the same page is for the looker (dashboards and explores) source. It does not fix this LookML warning.
Additional Notes
- After you change a recipe, re-run each affected ingestion source, then open the dataset's Lineage tab to check the edges.
- If you find a dataset with the not discoverable banner and a lowercase twin, the casing changed on a source that had already run. Follow the caution in step 1.
Related Documentation
Tags: lineage, missing-lineage, snowflake, dbt, looker, lookml, case-sensitivity, convert-urns-to-lowercase, derived-tables, service-account-permissions