Area: Ingestion Issues
Sub-Area: Databricks / Hive Metastore Source Configuration
Applies to: OSS + Cloud
Issue
You ingest Databricks Hive Metastore tables with the hive source and scheme: databricks+pyhive. Scheduled runs fail when the Databricks cluster or SQL warehouse is stopped at run time. On current CLI releases the same recipe fails config validation before it connects:
The databricks+pyhive scheme is no longer supported by the hive source. Use the unity-catalog source (with include_hive_metastore for legacy hive_metastore tables) to ingest Databricks.
You switch to the unity-catalog source, but your Databricks workspace has no Unity Catalog metastore assigned, so that source can't run either.
You Might Be Asking
- Can I keep using the
hivesource for Databricks? - How do I ingest only the legacy
hive_metastoretables with theunity-catalogsource? - Do I need to keep the SQL warehouse running, or switch to Serverless, for scheduled runs?
- Can the
unity-catalogsource run on a workspace with no Unity Catalog metastore?
Cause
The hive source no longer supports Databricks. Its config validation rejects scheme: databricks+pyhive, and it also rejects a sqlalchemy_uri that starts with databricks+pyhive://. No recipe setting turns this off.
The unity-catalog source is the supported way to ingest Databricks, including legacy hive_metastore tables. DataHub documents the source for Unity Catalog enabled workspaces. On every run, the source calls the Databricks Unity Catalog catalogs API to find catalogs, even when you only want hive_metastore. So the workspace needs a Unity Catalog metastore assigned. The connection test calls the same catalogs API, so it fails on that workspace too.
DataHub has no supported way to ingest a Databricks workspace that has no Unity Catalog metastore. You can ask DataHub Support to request this as a feature.
The separate metastore lookup runs only when include_metastore is true. That option defaults to false and is deprecated, so leave it unset.
Solution
-
Have a Databricks account admin assign a Unity Catalog metastore to the workspace.
-
Pick a SQL warehouse and put its id in
warehouse_id. The source readshive_metastoretables through this warehouse. You don't need to keep it running. Wheninclude_hive_metastoreis on, the source starts the warehouse at the start of the run and waits until it is up. If the id is wrong, the run fails withSQL warehouse not found. If you leavewarehouse_idout, the source turns off Hive Metastore extraction and reportsHive Metastore Extraction is disabled due to missing warehouse_id in config. -
Grant the service principal (or token owner) the permissions listed in the Databricks source prerequisites:
- For
hive_metastoretables:READ_METADATAandUSAGEon thehive_metastorecatalog, on the schemas you want, and on the tables and views you want. - For Unity Catalog objects:
USE CATALOGon the catalogs,USE SCHEMAon the schemas, and ownership orSELECTon the tables and views. - Access to the SQL warehouse in
warehouse_id.
- For
-
Use the
unity-catalogsource.include_hive_metastoredefaults totrue. Thecatalog_patternbelow keeps onlyhive_metastore. Remove it to ingest Unity Catalog catalogs too. Do not use thecatalogsoption to limit the run tohive_metastore. Acatalogslist looks up each catalog through the Unity Catalog API. The source then never readshive_metastorethrough your SQL warehouse. The^hive_metastore$pattern matches only whileinclude_metastoreis off. Leave that option unset.
source:
type: unity-catalog
config:
workspace_url: https://<your-workspace>.azuredatabricks.net
token: <your-databricks-token>
warehouse_id: <your-sql-warehouse-id>
include_hive_metastore: true
catalog_pattern:
allow:
- "^hive_metastore$"
sink:
type: datahub-rest
config:
server: <your-datahub-gms-url>
token: <your-datahub-access-token>
-
Use CLI version 1.7.0.20 or later. That release passes your token and
warehouse_idto thehive_metastoreconnection. If the source cannot connect tohive_metastore, the run reportsFailed to connect to hive_metastoreand skips those tables. -
Schedule the ingestion. Each run starts the warehouse itself.
The unity-catalog source reads catalogs, schemas, tables and columns for Unity Catalog objects through the REST API. It needs warehouse_id for hive_metastore tables, tag extraction and profiling. Without warehouse_id, it turns off tag and Hive Metastore extraction with a warning, and it fails config validation if profiling is on.
See Recipes for how recipes are structured.