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

Date and Time Functions not correctly translated (v18.5.0 , bigquery → mysql) #2214

Closed
rafaelzig opened this issue Sep 14, 2023 · 0 comments

Comments

@rafaelzig
Copy link

Input

sqlglot.transpile("SELECT TIMESTAMP_ADD('2018-05-01', INTERVAL 1 DAY)", read='bigquery', write='mysql')[0]
sqlglot.transpile("SELECT TIMESTAMP_SUB('2018-05-01', INTERVAL 1 DAY)", read='bigquery', write='mysql')[0]

Expected output

"SELECT DATE_ADD('2018-05-01', INTERVAL 1 DAY)"
"SELECT DATE_SUB('2018-05-01', INTERVAL 1 DAY)"

Actual output

"SELECT TIMESTAMP_ADD('2018-05-01', 1, DAY)"
"SELECT TIMESTAMP_SUB('2018-05-01', 1, DAY)"

Official Documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant