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:ย 

How to remove checkpoints from DeltaLake table ?

Hunter1604
New Contributor II

How to remove checkpoints from DeltaLake table ?

I see that on my delta table exist a few checkpoints I want to remove the oldest one. 

It seems that existing of it is blocking removing the oldest _delta_logs entries

5 REPLIES 5

Ajay-Pandey
Esteemed Contributor III

Hi @Pawel Wojโ€‹ ,

If you want to keep your checkpoints X days, you can set delta.checkpointRetentionDuration to X days this way:

spark.sql(f"""
        ALTER TABLE delta.`path`
            SET TBLPROPERTIES (
                delta.checkpointRetentionDuration = 'X days'
            )
        """
)

Ajay Kumar Pandey

Hi,

This looks well, thanks - will be testing it.

Ajay-Pandey
Esteemed Contributor III

Test and let me know if it's working for you.

Ajay Kumar Pandey

Anonymous
Not applicable

Hi @Pawel Wojโ€‹ 

Hope everything is going great.

Just wanted to check in if you were able to resolve your issue. If yes, would you be happy to mark an answer as best so that other members can find the solution more quickly? If not, please tell us so we can help you. 

Cheers!

Hi

Proposed solution looks good, I will be testing it,

but can you tell me why I can't found this param in offical DB documentation ?

I would like to have more infromation about before apply this configuration on prod evn.

BR

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