12-16-2023 06:02 PM
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?
01-16-2024 04:44 PM
Can anyone replicate this? Thanks.
03-23-2024 05:34 PM
I'm having this exact same issue. @SamGreene did you ever find a resolution to this?
03-23-2024 07:26 PM - edited 03-23-2024 07:27 PM
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
03-23-2024 08:31 PM
Yes, Danny, this is in an otherwise functional DLT SQL notebook. It happens when I add the function around an existing column being selected.
03-23-2024 07:34 PM
Yes, the notebook is set to SQL and the convert_timezone function is within a select statement.
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!