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

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