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: 

Snowflake query with time travel not working from Databricks while reading into Dataframe.

Skv
New Contributor II

I am trying to read the changes data from snowflake query into the dataframe using Databricks.

Same query is working in snowflake but not in Databricks. Both sides timezones and format are same for the timestamp. I am trying to implement changetracking feature from below query. No problem in snowflake but in databricks issue is coming.

Below is my query and error.

SELECT * FROM TestTable CHANGES(INFORMATION => DEFAULT) AT(TIMESTAMP => '2023-05-03 00:43:34.885 -7000')

Error:

Time travel data is not available for table TestTable. The requested time is either beyond the allowed time travel period or before the object creation time.

Please help.

1 ACCEPTED SOLUTION

Accepted Solutions

karthik_p
Esteemed Contributor

@SkvAdi v​ based on error it looks time provided seems to in correct, provided time stamp might be before object created date time. can you please check when table created and provide and test

View solution in original post

2 REPLIES 2

karthik_p
Esteemed Contributor

@SkvAdi v​ based on error it looks time provided seems to in correct, provided time stamp might be before object created date time. can you please check when table created and provide and test

sher
Valued Contributor II

you are format is wrong that's why you got an error

try this

SELECT * FROM TestTable CHANGES(INFORMATION => DEFAULT)

AT(TIMESTAMP => TO_TIMESTAMP_TZ('2023-05-03 00:43:34.885','YYYY-MM-DD HH24:MI:SS.FF')) 

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!