cancel
Showing results for 
Search instead for 
Did you mean: 
Administration & Architecture
Explore discussions on Databricks administration, deployment strategies, and architectural best practices. Connect with administrators and architects to optimize your Databricks environment for performance, scalability, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to check a specific table for it's VACUUM retention period

WWoman
Contributor

I'm looking for a way to query for the VACUUM retention period for a specific table. This does not show up with DESSCRIBE DETAIL <table_name>;

1 ACCEPTED SOLUTION

Accepted Solutions

filipniziol
Esteemed Contributor

Hi @WWoman ,

the default retention period is 7 days and as  per documentation it is regulated by 'delta.deletedFileRetentionDuration' table property:

filipniziol_0-1738092227320.png

If there is no delta.deletedFileRetentionDuration table property it means it uses the default, so 7 days.
If you set the delta.deletedFileRetentionDuration like this:

ALTER TABLE dev.bronze.source_table SET TBLPROPERTIES ('delta.deletedFileRetentionDuration' = '30 days');

you will be able to check the property by running SHOW TBLPROPERTIES:

SHOW TBLPROPERTIES dev.bronze.source_table;

The result:

filipniziol_1-1738092443138.png

However, one can always run the VACUUM overwriting the defaults, so if you have any process that explicitly states the number of retained hours, you won't be able to check this at table properties level:

filipniziol_2-1738092686127.png

 










View solution in original post

3 REPLIES 3

filipniziol
Esteemed Contributor

Hi @WWoman ,

the default retention period is 7 days and as  per documentation it is regulated by 'delta.deletedFileRetentionDuration' table property:

filipniziol_0-1738092227320.png

If there is no delta.deletedFileRetentionDuration table property it means it uses the default, so 7 days.
If you set the delta.deletedFileRetentionDuration like this:

ALTER TABLE dev.bronze.source_table SET TBLPROPERTIES ('delta.deletedFileRetentionDuration' = '30 days');

you will be able to check the property by running SHOW TBLPROPERTIES:

SHOW TBLPROPERTIES dev.bronze.source_table;

The result:

filipniziol_1-1738092443138.png

However, one can always run the VACUUM overwriting the defaults, so if you have any process that explicitly states the number of retained hours, you won't be able to check this at table properties level:

filipniziol_2-1738092686127.png

 










Thank you!

filipniziol
Esteemed Contributor

No problem, glad it was helpful!