cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Using Delta Tables without Time Travel features?

Mark1
New Contributor II

Hi Everyone / Experts,

is it possible to use Delta Tables without the Time Travel features? We are primarily interested in using the DML Features (delete, update, merge into, etc)

Thanks,

Mark

1 ACCEPTED SOLUTION

Accepted Solutions

Hubert-Dudek
Esteemed Contributor III

You can use the below code to delete all time travel features (older snapshot) older than 1 hour. Better not use 0 hours as you can delete current write and have a data consistency problem. If you don't need ACID features, including the ability to do concurrent writes, you can consider using parquet instead.

from delta.tables import *
spark.conf.set("spark.databricks.delta.retentionDurationCheck.enabled", "false")
deltaTable = DeltaTable.forPath(spark, deltaPath)
deltaTable.vacuum(1)

View solution in original post

2 REPLIES 2

Hubert-Dudek
Esteemed Contributor III

You can use the below code to delete all time travel features (older snapshot) older than 1 hour. Better not use 0 hours as you can delete current write and have a data consistency problem. If you don't need ACID features, including the ability to do concurrent writes, you can consider using parquet instead.

from delta.tables import *
spark.conf.set("spark.databricks.delta.retentionDurationCheck.enabled", "false")
deltaTable = DeltaTable.forPath(spark, deltaPath)
deltaTable.vacuum(1)

Mark1
New Contributor II

Thank you Hubert

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.