cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Delete Partition Folders

shadowinc
New Contributor III

Hello team, as DataBricks moved away from hive-style partitioning, we can see some 2-letter partition folders created. And I have observed that the vacuum doesn't delete these folders (even though they are empty). Is there any way to delete those using built-in features like REORG?

Of course, we can do it by looping over folders/subfolders, checking if they are empty, and then deleting but I am afraid it might break some logs, etc.

I would appreciate your help. If anyone has a better idea, please do share.

1 REPLY 1

Alberto_Umana
Databricks Employee
Databricks Employee

Hello @shadowinc,

VACUUM is used to clean up unused and stale data files that are no longer referenced by a Delta table and are older than a specified retention period (default is 7 days). It does not remove empty directories. I think manual cleanup will be the way to go. I will check if any other workaround and let you know.

Connect with Databricks Users in Your Area

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