You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In snowflake environment
select to_char(current_timestamp(),'YYYY-MM-DDTHH24:MI:SS.FF3Z'); --output : 2024-11-12T04:06:57.034Z
In databtricks environmnet
select TO_CHAR(pos.exec_time, 'YYYY-MM-DDTHH24:MI:SS.FF3Z'); -- error: --
--[INCONSISTENT_BEHAVIOR_CROSS_VERSION.DATETIME_WEEK_BASED_PATTERN] You may get a different result due to
--the upgrading to Spark >= 3.0: All week-based patterns are unsupported since Spark 3.0, detected week-based character: Y.
--Please use the SQL function EXTRACT instead. SQLSTATE: 42K0B.
Is there an existing issue for this?
Category of Bug / Issue
Other
Current Behavior
Snowflake code input: to_char(pos.exec_time,'YYYY-MM-DDTHH24:MI:SS.FF3Z')
Databricks code output: TO_CHAR(pos.exec_time, 'YYYY-MM-DDTHH24:MI:SS.FF3Z')
Expected Behavior
Desired Databricks code output:
REPLACE(CONCAT(TO_CHAR(current_timestamp(), 'yyyy-MM-dd HH:mm:ss.SSS'), 'Z'), ' ', 'T')
Steps To Reproduce
In snowflake environment
select to_char(current_timestamp(),'YYYY-MM-DDTHH24:MI:SS.FF3Z'); --output : 2024-11-12T04:06:57.034Z
In databtricks environmnet
select TO_CHAR(pos.exec_time, 'YYYY-MM-DDTHH24:MI:SS.FF3Z'); -- error: --
--[INCONSISTENT_BEHAVIOR_CROSS_VERSION.DATETIME_WEEK_BASED_PATTERN] You may get a different result due to
--the upgrading to Spark >= 3.0: All week-based patterns are unsupported since Spark 3.0, detected week-based character: Y.
--Please use the SQL function EXTRACT instead. SQLSTATE: 42K0B.
while
select REPLACE(CONCAT(TO_CHAR(current_timestamp(), 'yyyy-MM-dd HH:mm:ss.SSS'), 'Z'), ' ', 'T'); --output : 2024-11-12T04:06:57.034Z
Relevant log output or Exception details
No response
Sample Query
No response
Operating System
macOS
Version
latest via Databricks CLI
The text was updated successfully, but these errors were encountered: