Area: Ingestion Issues
Sub-Area: Hive Ingestion
Applies to: OSS + Cloud
Issue
Hive ingestion runs for hours, or fails, on a large Hive deployment with many databases and tables. Recipes that use keys such as partition_parallelism, max_partitions, partition_fetch_batch_size or metastore_uri fail validation, because the hive source has no such keys.
You Might Be Asking
- Why is my Hive ingestion taking hours to complete?
- Can I limit the number of partitions DataHub ingests from Hive?
- Why does my recipe fail with unknown keys such as
partition_parallelismormetastore_uri?
Cause
The hive source does not ingest individual partitions, so the partition count of a table does not set how much metadata DataHub reads. For each table, the source makes one inspector.get_indexes call and uses the returned column names as the table's partition keys in the schema.
Run time grows with the number of databases and tables the recipe covers, and with optional features such as profiling and storage lineage. Recipe keys must match the source's config. Config models reject unknown keys, so a recipe with a key the source doesn't have fails validation before ingestion starts.
The hive source connects to HiveServer2 with host_port. It has no metastore_uri key. A Thrift metastore on port 9083 is read by the separate hive-metastore source with connection_type: thrift.
Solution
-
Remove
partition_parallelism,max_partitions,partition_fetch_batch_size,metastore_uriandinclude_table_lineagefrom your recipe. There are no partition settings to tune. -
Narrow the scope with
database_pattern. Thehivesource processes only the databases this pattern allows. Patterns match from the start of the name and ignore case, so anchor with^...$for an exact match. Deny is checked first. -
Keep profiling off.
profiling.enabledisfalseby default. If you turned it on, turn it off, or see SQL Profiling for ways to reduce its cost. -
Leave
emit_storage_lineageoff. It isfalseby default. If you need storage lineage but not column-level storage lineage, setinclude_column_lineage: false. This key only applies whenemit_storage_lineageis on and has nothing to do with partitions.
Example:
source:
type: hive
config:
host_port: "<hiveserver2-host>:<port>"
database_pattern:
allow:
- "^sales$"
- "^marketing$"
profiling:
enabled: false
emit_storage_lineage: false
Add your usual connection settings to config.
- If you use stateful ingestion with
remove_stale_metadata(defaulttrue), narrowing the scope soft-deletes entities that were in the last successful run and are now missing. If the drop is abovestateful_ingestion.fail_safe_threshold(default75.0), the run skips stale removal and reportsSkipping stateful ingestion / stale entity removal. If the removal is intended, raisefail_safe_thresholdfor that run. See Stateful Ingestion.