-
Notifications
You must be signed in to change notification settings - Fork 25.6k
SQL: adds format parameter to range queries for constant date comparisons #45326
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
Conversation
used in comparison conditions
|
Pinging @elastic/es-search |
|
@elasticmachine run elasticsearch-ci/default-distro |
costin
left a comment
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
| client().performRequest(request); | ||
| } | ||
|
|
||
| private ZonedDateTime nowWithMillisResolution(String zoneId) { |
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.
Can't you use DateUtils.nowWithMillisResolution?
|
@elasticmachine run elasticsearch-ci/2 |
|
@elasticmachine run elasticsearch-ci/packaging-sample |
…sons (elastic#45326) * Add format parameter to the range queries built for CURRENT_* functions used in comparison conditions * Use range queries for date fields equality/non-equality as well. (cherry picked from commit c1e81e9)
Whenever a date field is used in a <, >, <=, >= comparison, a
rangequery is built. This includes any output fromCURRENT_*/NOW/TODAYfunctions. This PR adds theformatparameter to these range queries and sets the value of the date constant as String.Also, it changes the = and != operators to use a
rangequery as well, to have the proper format for the literal used in the equality/non-equality condition.Fixes #45139.