lakehouse.databricks.common.vacuum_table
- lakehouse.databricks.common.vacuum_table(spark, delta_db, delta_table, retention_period=None)
A function to vacumm a delta table
Parameters
- sparkspark context
spark context passed from the calling spark instance
- delta_dbstring
The name of the delta db where the table exists
- delta_tablestring
The name of the table to vacuum
- retention_period: int, in hours default=None
The number of hours you would like to retain 7 days is 168 Hours; if no value added the default retention will be used, Databricks default is 7 days
Returns
- In the case of an Exception a JSON object describing the error is returned
{"error-message": f"error vacuuming table {delta_db}.{delta_table}- {Exception}"}