Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: dateformat 'yyyymmdd' throwing error while executing the code in Databricks DBSQL #1186

Open
1 task done
ajinkya441 opened this issue Nov 12, 2024 · 0 comments · May be fixed by #1221
Open
1 task done

[BUG]: dateformat 'yyyymmdd' throwing error while executing the code in Databricks DBSQL #1186

ajinkya441 opened this issue Nov 12, 2024 · 0 comments · May be fixed by #1221
Assignees
Labels
bug Something isn't working

Comments

@ajinkya441
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Category of Bug / Issue

Other

Current Behavior

Snowflake code input: to_char(pos.createdwhen,'yyyymmdd')
Databricks code output: TO_CHAR(pos.createdwhen, 'yyyymmdd')

Expected Behavior

Databricks code output: TO_CHAR(pos.createdwhen, 'yyyyMMdd')

Steps To Reproduce

  1. In snowflake environment:
    select to_char(current_timestamp(),'yyyymmdd'); --output: 20241112

  2. In databricks environment:
    select to_char(current_timestamp(),'yyyymmdd'); --output: 20240012
    while
    select to_char(current_timestamp(),'yyyyMMdd'); --output: 20241112 [correct output with format 'yyyyMMdd' ]

Relevant log output or Exception details

No response

Sample Query

No response

Operating System

macOS

Version

latest via Databricks CLI

@ajinkya441 ajinkya441 added the bug Something isn't working label Nov 12, 2024
@sriram251-code sriram251-code self-assigned this Nov 18, 2024
@sriram251-code sriram251-code linked a pull request Nov 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants