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

ajaypanday6781
Esteemed Contributor II

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'
            )
        """
)

Hi,

This looks well, thanks - will be testing it.

ajaypanday6781
Esteemed Contributor II

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

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!

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.