Area: Ingestion Issues
Sub-Area: Stateful Ingestion and Cross-Source Entity Management
Applies to: OSS + Cloud
Issue
Temporary tables or other assets appear in DataHub even though they no longer exist in the source system. Stateful ingestion is on and remove_stale_metadata is true, but the assets stay.
You Might Be Asking
- Why are expired BigQuery temporary tables still showing in DataHub when stateful ingestion is on?
- How do I find which ingestion recipe is writing these assets?
- Why does a deny pattern for temporary tables risk removing real tables?
Cause
remove_stale_metadata (default true) soft deletes entities that were present in a source's last successful run and are missing from its current run. See Stateful Ingestion and Stale Entity Removal.
fail_safe_threshold (default 75.0, range 0 to 100) is a safety check. If the relative change in entities is above the threshold, the run skips the soft deletes and does not commit the state.
Stateful ingestion is off by default (enabled defaults to false). If you turn it on, pipeline_name must be set. Without it, the run fails with a configuration error that begins "pipeline_name must be set when stateful ingestion is enabled."
For BigQuery, temp_table_dataset_prefix defaults to _. It marks tables in datasets whose names start with that prefix as temporary. It does not match table names inside regular datasets. The queries extractor also treats a table as temporary when your dataset patterns allow it, a discovered-tables list exists, and the table is not in that list. These tables are recorded in report.inferred_temp_tables. See BigQuery Source Configuration.
Solution
-
Find the recipe that writes the assets. Check whether you run more than one recipe against the same BigQuery project, for example one for metadata and one for lineage and usage. By default, each recipe run stamps the system metadata of what it writes with its
runIdandpipelineName. Compare thepipelineNameandrunIdon an affected asset with your recipes to see which run wrote it. -
Filter the same tables in every recipe. Add the same table filter to each BigQuery recipe so no recipe picks up the temporary tables. Filter patterns ignore case by default. A broad pattern such as one that matches the text "temp" also matches real tables like
temperatureortemplate. Withremove_stale_metadataon, the next run soft deletes those real tables. Thefail_safe_thresholdcheck only stops large changes, so it does not protect a few real tables. Write patterns that match only your temporary tables. Use^...$for an exact match. Check the BigQuery config reference for the filter keys. -
Check the stateful ingestion settings. In the metadata recipe:
source:
type: bigquery
config:
# ... your existing config
stateful_ingestion:
enabled: true
remove_stale_metadata: true
fail_safe_threshold: 75.0
Raise fail_safe_threshold only if you expect a large, intended drop in entities.
-
Clean up assets that are already in DataHub. Soft delete them in the UI. In search, select the assets with the bulk select and use the Delete bulk action. It opens a confirmation modal. In Cloud, the action is titled "Mark as deleted". A soft delete is not a hard delete. See Deleting Metadata and Entities for how soft and hard deletes differ and how to undo a soft delete.
-
Check the next runs. After you apply the filters, run each recipe and confirm that the temporary tables are not created again.