04-01-2024 12:44 PM
Hi,
I'm trying to do the vacuum on a Delta table within a unity catalog. The default retention is 7 days. Though I vacuum the table, I'm able to see the history beyond 7 days. Tried restarting the cluster but still not working. What would be the fix ?
04-04-2024 07:54 AM
Hi @Kavi_007 , Vacuum only deletes stale files i.e. the files that are not being tracked by delta log. If you perform a delete operation, then the files will become stale and will be cleared after 7 days. From the delta history of your table, I do not see any delete operation. So, vacuum will not delete any file.
04-03-2024 08:38 PM - edited 04-03-2024 08:40 PM
Yes, below are the commands.
History of the table:
04-04-2024 07:06 AM
@Retired_mod - Could you please check this?
04-04-2024 07:54 AM
Hi @Kavi_007 , Vacuum only deletes stale files i.e. the files that are not being tracked by delta log. If you perform a delete operation, then the files will become stale and will be cleared after 7 days. From the delta history of your table, I do not see any delete operation. So, vacuum will not delete any file.
04-04-2024 01:00 PM
@Lakshay - you are right. I performed a couple of delete statements and then did VACCUM. It worked now. Thanks for your help !
04-05-2024 09:38 AM
Happy to help!
04-04-2024 12:06 PM
No, that's wrong. VACUUM removes all files from the table directory that are not managed by Delta, as well as data files that are no longer in the latest state of the transaction log for the table and are older than a retention threshold.
VACUUM - Azure Databricks - Databricks SQL | Microsoft Learn
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.
If there isn’t a group near you, start one and help create a community that brings people together.
Request a New Group