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: 

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

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now