-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Handle NULL arithmetic operations with INTERVALs #49633
Conversation
Pinging @elastic/es-search (:Search/SQL) |
arithmetic operators are supported.
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.
LGTM. Minor suggestion: Combine all null +/-/* interval in one query in integ tests.
Maybe two queries one for null on the left side one on the right, or maybe even 3 queries
each testing one operator.
@astefan thx! Adding the numeric-null operations will catch any future bugs in that area. |
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.
LGTM - do the other operators handle Null accordingly?
I wonder if going forward we could generalize this a bit since all operators would have to take into account null so maybe instead of checking explictly for null, we can do the check in the base TypeResolver
base class and act accordingly so children would only have to worry about actual values.
@costin the other operators seem to handle NULL properly. There is a test I added for all the math operators with NULL combinations here https://github.com/elastic/elasticsearch/pull/49633/files#diff-c579a8eae7dda4bd86f6ce71c5bc0c36R24. |
(cherry picked from commit ce72761)
(cherry picked from commit ce72761)
Up until this change, NULL (as a data type) was not permitted in *, +, - operations involving intervals, an error message being generated.
Fixes #49297.