Area: Ingestion
Sub-Area: Data Catalogs
Applies to: OSS + Cloud
Issue
Databricks Unity Catalog metadata is not syncing to DataHub, the recipe fails validation, or lineage from notebooks and tables is incomplete.
You Might Be Asking
- How do I sync Unity Catalog to DataHub?
- What permissions does the Unity Catalog service principal need?
- Can DataHub extract lineage from Databricks notebooks?
- Why is my lineage missing, or why does my recipe fail on an unknown key?
Cause
Three things cause most problems:
-
Unknown recipe keys. The unity-catalog source rejects keys it does not define, so one wrong key fails the whole recipe. Keys such as
parse_notebook_sql,include_usage_stats,external_location_map,platform_instance_map,include_delta_metadataandinclude_table_propertiesdo not exist on this source. -
No
warehouse_id. Tag extraction, thehive_metastorecatalog, system-table lineage and profiling all need a SQL warehouse. Withoutwarehouse_id, the source turns offinclude_tagsandinclude_hive_metastoreand logs a warning. Profiling withoutwarehouse_idfails withwarehouse_id must be set when profiling is enabled. - Missing privileges. The service principal needs access to each catalog, schema and table you ingest, and to notebook folders if you ingest notebooks.
Solution
1. Configure the source
Use type: unity-catalog (the alias databricks also works). workspace_url is required. Authenticate with token (a personal access token), with client_id plus client_secret (a service principal), or with azure_auth.
source:
type: unity-catalog
config:
workspace_url: "https://your-workspace.cloud.databricks.com"
token: "${DATABRICKS_TOKEN}"
warehouse_id: "<your-sql-warehouse-id>"
catalog_pattern:
allow: ["prod_catalog", "analytics_catalog"]
schema_pattern:
allow: [".*"]
deny: [".*_temp$"]
include_table_lineage: true
include_column_lineage: true
include_notebooks: true
include_ownership: true
Notes on this recipe:
-
warehouse_idis optional, but set it if you want tags, thehive_metastorecatalog or system-table lineage. - With the default settings,
catalog_patternmatches against the bare catalog name. -
include_table_lineageandinclude_column_lineagedefault to true. Column lineage makes one REST call per column, which can slow ingestion. -
include_ownershipdefaults to false.
2. Give the service principal the right access
The Databricks docs list these privileges for the service principal:
- On each catalog: metastore admin, ownership, or
USE CATALOG. - On each schema: metastore admin, ownership, or
USE SCHEMA. - On tables and views: ownership or
SELECT. - For usage statistics from system tables (
usage_data_sourceset toSYSTEM_TABLES, orAUTOwithwarehouse_id):CAN_USEon the SQL warehouse, plusSELECTonsystem.query.historyandsystem.access.table_lineage. - For notebooks:
CAN_READon the folders that hold the notebooks.
See Prerequisites.
3. Understand how lineage is read
lineage_data_source defaults to AUTO:
- With
warehouse_idset, the source readssystem.access.table_lineageandsystem.access.column_lineage. - Without
warehouse_id, it uses the Databricks REST API. -
SYSTEM_TABLESforces system tables and needs a warehouse.APIforces the REST API.
So a recipe without warehouse_id does not read the system tables, and a grant on system.access.table_lineage does not affect its lineage.
4. Extract notebook lineage
source:
type: unity-catalog
config:
workspace_url: "https://your-workspace.cloud.databricks.com"
token: "${DATABRICKS_TOKEN}"
include_notebooks: true
notebook_pattern:
allow: ["/Production/.*"]
include_notebooks defaults to false. notebook_pattern matches against the notebook path. Notebook lineage comes from Databricks lineage records (the downstream notebooks of each table). DataHub does not parse notebook commands. The service principal needs CAN_READ on the notebook folders.
5. External tables
You do not map external locations in the recipe. include_external_lineage defaults to true and creates lineage for external S3 tables only. Other storage, such as abfss:// locations, is not covered.
6. Delta Lake tables
Delta handling uses emit_siblings (default true) and delta_lake_options. There is no include_delta_metadata or include_table_properties key. See the config details for the full field list.
Running on DataHub Cloud
The recipe keys and behavior are the same for Cloud and OSS. Change them in the recipe of your ingestion source.
Additional Notes
- Usage statistics use
include_usage_statistics(default true), notinclude_usage_stats. - Tags are read only when
warehouse_idis set andinclude_tagsis not false.
Related Documentation
Tags: databricks, unity-catalog, delta-lake, notebooks, workflows, spark, data-catalog, column-lineage