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')) 

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