hudi icon indicating copy to clipboard operation
hudi copied to clipboard

HUDI DELETE

Open reena-cs opened this issue 6 years ago • 7 comments

Describe the problem you faced

I am trying to delete a record, yes the delete operation was reflected, but I still find a hard copy of the files in s3. To Reproduce

Steps to reproduce the behavior:

1.I tried inserting a few records, then update a few and delete a few, but in my s3 folder i only saw few more files being created for the partition i updated or delted. So if i read through any other service then, i see duplicates.

Expected behavior

A clear and concise description of what you expected to happen. When i update a record I ideally want only one file(the latest version) and when i delete i want only the latest version (minus the deleted record)

Environment Description

  • Hudi version :0.53

  • Spark version :2.44

  • Storage (HDFS/S3/GCS..) :s3

  • Running on Docker? (yes/no) : no

Additional context

For GDPR purpose , once a delete is performed we shouldn't be able to read/trace back the record again.

reena-cs avatar Jul 16 '20 21:07 reena-cs

@nsivabalan : Would you be able to take this up ?

bvaradar avatar Jul 17 '20 02:07 bvaradar

Adding

"hoodie.cleaner.commits.retained": "1", "hoodie.cleaner.fileversions.retained": "1"

in my option has helped me, can someone verify if i am doing the right operation? As mentioned above we are doing this for GDPR compliance and we won't revert it back so having just the latest file will do right?

reena-cs avatar Jul 17 '20 10:07 reena-cs

yes, if you want all older copies to be deleted, guess you have to set the configs you have listed. For incremental pulling, point in time queries, etc older commits will still have the records. only the commit in which delete was issued will have the record deleted. So if you query the table in general with latest data, you will not see the deleted records. But if you query with a older commit time, you could see the deleted record as per that time instant, since these records are not deleted as of that time instant.

nsivabalan avatar Jul 17 '20 13:07 nsivabalan

yes, if you want all older copies to be deleted, guess you have to set the configs you have listed. For incremental pulling, point in time queries, etc older commits will still have the records. only the commit in which delete was issued will have the record deleted. So if you query the table in general with latest data, you will not see the deleted records. But if you query with a older commit time, you could see the deleted record as per that time instant, since these records are not deleted as of that time instant.

Thanks, it was helpful. But i wonder how querying an older commit time will show the deleted record. Because file versions retained is set 1, then how will it retrive it?

reena-cs avatar Jul 17 '20 18:07 reena-cs

I didn't mean it that way. if you are ok giving up older commits, then setting the two config params you posted would suffice. But incase you want to retain older commits and you also want deletes to delete all older copies, I don't think its doable as of now.

nsivabalan avatar Jul 17 '20 21:07 nsivabalan

@reenarosid @nsivabalan : Can we close this issue ?

bvaradar avatar Jul 22 '20 15:07 bvaradar

it is already closed.

nsivabalan avatar Jul 23 '20 03:07 nsivabalan