โ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