https://delta.io logo
a

Akshay Ghiya

03/09/2023, 2:05 PM
Hi I am using delta lake version 1.0.0. I want to revert my table to previous version. Please help how can I do that. I am unable to run the following query
Copy code
spark.sql("SELECT * from governor.governor_transactions VERSION AS OF 516")
Getting following error
Copy code
mismatched input 'AS' expecting {<EOF>, ';'}(line 1, pos 53)
Using the following property
Copy code
spark.sql.extensions='io.delta.sql.DeltaSparkSessionExtension'
spark.sql.catalog.spark_catalog='org.apache.spark.sql.delta.catalog.DeltaCatalog'
Please help
n

Nick Karpov

03/09/2023, 2:12 PM
you need to use Delta v2.1+ if you want to use the SQL API (it requires Spark 3.3) - otherwise you need to use python/scala api https://docs.delta.io/1.0.0/quick-start.html#-read-older-versions-of-data-using-time-travel
a

Akshay Ghiya

03/10/2023, 3:28 AM
ohh ok.. thanks
2 Views