cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

CONVERT_TIMEZONE issue in DLT

SamGreene
Contributor II

I can run a query that uses the CONVERT_TIMEZONE function in a SQL notebook.  When I move the code to my DLT notebook the pipeline produces this error:

Cannot resolve function `CONVERT_TIMEZONE`

Here is the line:  CONVERT_TIMEZONE('UTC', 'America/Phoenix', date_time) as local_datetime

Should this work?

 

5 REPLIES 5

SamGreene
Contributor II

Can anyone replicate this?  Thanks. 

annn
New Contributor II

I'm having this exact same issue. @SamGreene did you ever find a resolution to this?

Danny_Lee
Valued Contributor

Have you added

%sql

magic command?

Also, did you SELECT the CONVERT_TIMEZONE?  

> SELECT convert_timezone('America/Los_Angeles', 'UTC', timestamp_ntz'2021-12-06 00:00:00');
2021-12-06 08:00:00

-- Current session local timezone: UTC
> SELECT convert_timezone('America/Los_Angeles', timestamp_ntz'2021-12-06 08:00:00');;
2021-12-06 00:00:00

From docs: https://docs.databricks.com/en/sql/language-manual/functions/convert_timezone.html

--
The heart that breaks open can contain the whole universe. - Joanna Macy

Yes, Danny, this is in an otherwise functional DLT SQL notebook.  It happens when I add the function around an existing column being selected. 

annn
New Contributor II

Yes, the notebook is set to SQL and the convert_timezone function is within a select statement.

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local communityโ€”sign up today to get started!

Sign Up Now