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

Fix sneaky date_histogram bug #65707

Merged
merged 3 commits into from
Dec 7, 2020
Merged

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Dec 1, 2020

date_histogram has a bug with offset and extended_bounds when it
needs to create an "empty" aggregation result: it includes the bounds
twice! Wooops!

I broke this a while back when I started trying to merge offset into
Rounding. I never finished that merge, sadly. Interestingly, we've
discovered that the merge is required to properly handle daylight
savings time (#56305) but it isn't really something we're looking to
solve today. For now, this just stops counting the offset twice.

Closes #65624

`date_histogram` has a bug with `offset` and `extended_bounds` when it
needs to create an "empty" aggregation result: it includes the bounds
twice! Wooops!

I broke this a while back when I started trying to merge `offset` into
`Rounding`. I never finished that merge, sadly. Interestingly, we've
discovered that the merge is required to properly handle daylight
savings time (elastic#56305) but it isn't really something we're looking to
solve today. For now, this just stops counting the offset twice.

Closes elastic#65624
@nik9000 nik9000 requested a review from not-napoleon December 1, 2020 21:50
@elasticmachine elasticmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Dec 1, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

Copy link
Member

@not-napoleon not-napoleon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -1235,6 +1235,19 @@ public void testIllegalInterval() throws IOException {
assertWarnings("[interval] on [date_histogram] is deprecated, use [fixed_interval] or [calendar_interval] in the future.");
}

public void testBuildEmpty() throws IOException {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test needs a comment; it's a subtle bug, and it's not super clear how this test catches it.

@nik9000 nik9000 merged commit ecb4e16 into elastic:master Dec 7, 2020
nik9000 added a commit to nik9000/elasticsearch that referenced this pull request Dec 7, 2020
`date_histogram` has a bug with `offset` and `extended_bounds` when it
needs to create an "empty" aggregation result: it includes the bounds
twice! Wooops!

I broke this a while back when I started trying to merge `offset` into
`Rounding`. I never finished that merge, sadly. Interestingly, we've
discovered that the merge is required to properly handle daylight
savings time (elastic#56305) but it isn't really something we're looking to
solve today. For now, this just stops counting the offset twice.

Closes elastic#65624
nik9000 added a commit that referenced this pull request Dec 7, 2020
`date_histogram` has a bug with `offset` and `extended_bounds` when it
needs to create an "empty" aggregation result: it includes the bounds
twice! Wooops!

I broke this a while back when I started trying to merge `offset` into
`Rounding`. I never finished that merge, sadly. Interestingly, we've
discovered that the merge is required to properly handle daylight
savings time (#56305) but it isn't really something we're looking to
solve today. For now, this just stops counting the offset twice.

Closes #65624

* Fixup
nik9000 added a commit to nik9000/elasticsearch that referenced this pull request Dec 8, 2020
After backporting elastic#65707 we can now run it in our backwards
compatibility tests.
nik9000 added a commit that referenced this pull request Dec 8, 2020
After backporting #65707 we can now run it in our backwards
compatibility tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Aggregations Aggregations >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v7.11.0 v8.0.0-alpha1
Projects
None yet
4 participants