0

I have created an delta lake table with the following code:

%%pyspark
df = spark.read.load('abfss://email address removed for privacy reasons/data/MoviesDB.csv', format='csv'
, header=True
)
 
delta_table_path = "/delta/movies-delta"
df.write.format("delta").save(delta_table_path)

And I created a database with a managed table:

spark.sql("CREATE DATABASE Movies")
df.write.format("delta").saveAsTable("Movies.MoviesManaged")

I used SQL-code to add a row

%%sql
INSERT INTO MoviesManaged VALUES (999999, 'Nothing Hill', 'Romance', 1999, 8, 1)

I can query the history

%%sql
DESCRIBE HISTORY MoviesManaged

But when I try the example I've seen everywhere on the Internet on how to ask for a specific version, I get an error on the keyword AS

%%sql
SELECT * FROM MoviesManaged VERSION AS OF 1

Same thing if I try to use the timestamp from the history. I looks like I should have added some module. But I've no idea how to make this work.

Can anyone help me?

Alex Ott
  • 80,552
  • 8
  • 87
  • 132
Ellen
  • 1
  • 3

0 Answers0