-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
SQL: use calendar interval of 1y instead of fixed interval for grouping by YEAR and HISTOGRAMs #47558
Conversation
HISTOGRAM(INTERVAL '1' YEAR).
Pinging @elastic/es-search (:Search/SQL) |
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
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
Make sure to indicate the versions selected for backporting. Considering it's a behavior change, I'm on the fence on whether we should do any backporting. |
@elasticmachine run elasticsearch-ci/packaging-sample |
Because Elasticsearch forces users to use a fixed interval for all nX periods of time (3 days, 4 years, 5 months etc), to have a consistent behavior throughout SQL, the
fixed_interval
approach was chosen. But this resulted in having an unintuitive behavior for intervals of one year.This PR changes grouping by YEAR() and HISTOGRAMs with
INTERVAL '1' YEAR
to use adate_histogram
withcalendar_interval
of1y
.Fixes #40162.