-
Notifications
You must be signed in to change notification settings - Fork 583
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
fix: Support expr
instead of string
for argument to interval
#517
Conversation
Great to see this. There's related discussion in #298. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me -- thank you @togami2864
@togami2864 -- there appear to be some CI failures |
@alamb I fixed all CI failures. Thanks. |
Pull Request Test Coverage Report for Build 2487582432
💛 - Coveralls |
expr
instead of string
for argument to interval
expr
instead of string
for argument to interval
expr
instead of string
for argument to interval
Thanks @togami2864 |
…pache#517) * fix: use expr instead of string in interval * chore: resolve CI Co-authored-by: togami2864 <[email protected]>
Can drop this after rebase on commit d981f70 "fix: Support expr instead of string for argument to interval (apache#517)", first released in 0.19.0
Pull Request Test Coverage Report for Build 2487582432Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
In Big Query and MySQL, the following query is valid:
https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions#date_add
https://www.w3schools.com/mysql/func_mysql_date_add.asp
But now if the expression is number, an error occurred because the type of the value in
interval
isString
https://github.com/sqlparser-rs/sqlparser-rs/blob/ca15a4edbf1de4c00304b12e44d3adf9ac729406/src/ast/value.rs#L53
This PR replaces
String
withExpr
to run correctly inInterval
One concern thing is that should I validate when the other dialect like
PostgresSQL
,sqlite
. I don't know if the query is valid except for Big query and MySQL.