Datahub UI isn't picking up my entity when I re-in...
# ingestion
o
Datahub UI isn't picking up my entity when I re-ingest it after a soft delete. The soft-delete sets '{"removed":true}' for the "status" aspectName, as per my look into the Mysql. But the re-ingest isn't touching the removed:true entry at all. My re-ingest is based on sending an UPSERT of with aspectName "schemaMetadata", and the same urn value as the original ingest.
The Hard Delete version of the API works fine (/entities?action=delete) in conjunction with a subsequent UPSERT of schemaMetadata. Is it ok to use hard deletes, or do you have any recommendations about using soft-deletes? For my use case we're fine with permanently wiping out data.
m
during a reingest you should re-emit the status aspect with
removed: False
if you want the entity to re-emerge.
all the out-of-the-box connectors do this
I assume you are emitting metadata manually in this case?
o
Thanks. We're using RestEmitter but only invoking UPSERT with schemaMetadata (and a tableProperties update). There's no use of Status object there. Probably that's the issue! Will see if I can get that part of code modified.
Emitting "removed:false" for aspectName "status" along with schemaMetadata etc is making the entry show up in the UI after the soft-delete. But I see in mysql that there are two entries now for the "status". Is Datahub smart enough to pick up the latest of these two? mysql> select metadata from metadata_aspect_v2 where urn='urnlidataset:(urnlidataPlatform:myDp,myDb.myTable,DEV)' and aspect='status'; +-------------------+ | metadata | +-------------------+ | {"removed":false} | | {"removed":true} | +-------------------+
s
You need to check the version column.
version = 0
is what is used