Skip to content

Commit

Permalink
feat(ingest): enable container stateful ingestion
Browse files Browse the repository at this point in the history
  • Loading branch information
wangsaisai authored and wangsaisai committed Nov 4, 2022
1 parent 3080b9e commit d7f142f
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

from datahub.configuration.common import AllowDenyPattern
from datahub.emitter.mce_builder import (
make_container_urn,
make_data_platform_urn,
make_dataplatform_instance_urn,
make_dataset_urn_with_platform_instance,
Expand Down Expand Up @@ -589,6 +590,10 @@ def gen_database_containers(self, database: str) -> Iterable[MetadataWorkUnit]:
domain_urn=domain_urn,
)

# Add container to the checkpoint state
container_urn = make_container_urn(database_container_key.guid())
self.stale_entity_removal_handler.add_entity_to_state("container", container_urn)

for wu in container_workunits:
self.report.report_workunit(wu)
yield wu
Expand All @@ -610,6 +615,10 @@ def gen_schema_containers(
database_container_key,
)

# Add container to the checkpoint state
container_urn = make_container_urn(schema_container_key.guid())
self.stale_entity_removal_handler.add_entity_to_state("container", container_urn)

for wu in container_workunits:
self.report.report_workunit(wu)
yield wu
Expand Down

0 comments on commit d7f142f

Please sign in to comment.