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

Begin moving date_histogram to offset rounding #50873

Merged
merged 4 commits into from
Jan 14, 2020

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Jan 10, 2020

We added a new rounding in #50609 that handles offsets to the start and
end of the rounding so that we could support offset in the composite
aggregation. This starts moving date_histogram to that new offset.

We added a new rounding in elastic#50609 that handles offsets to the start and
end of the rounding so that we could support `offset` in the `composite`
aggregation. This starts moving `date_histogram` to that new offset.
@elasticmachine
Copy link
Collaborator

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

@nik9000
Copy link
Member Author

nik9000 commented Jan 10, 2020

Neat! Real test failure.

@nik9000
Copy link
Member Author

nik9000 commented Jan 12, 2020

@elasticmachine, run elasticsearch-ci/2

@nik9000 nik9000 requested a review from not-napoleon January 13, 2020 15:53
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.

Looks good overall, but I'm a little concerned about the new & deprecated offset() method, as noted. If there's a plan for that, then I'm ok to merge as is, but I'd like to be explicit about the plan.

Rounding effectiveRounding = rounding.withoutOffset();
return new ExtendedBounds(
min != null ? effectiveRounding.round(min) : null,
max != null ? effectiveRounding.round(max) : null);
Copy link
Member

Choose a reason for hiding this comment

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

Excellent formatting choice, much more readable.

@@ -153,10 +151,6 @@ public void collect(int doc, long bucket) throws IOException {
};
}

private long offsetAwareRounding(Rounding rounding, long value, long offset) {
Copy link
Member

Choose a reason for hiding this comment

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

Glad to see this getting moved into the rounding itself. Makes much more sense.

* so keep any usage to migratory shims
*/
@Deprecated
public abstract long offset();
Copy link
Member

Choose a reason for hiding this comment

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

What's the plan to migrate away from this? I'm not sure I understand the benefit to adding a deprecated method now that we intend to remove in the next PR, as opposed to just removing the need for it in this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

I added this to cut the PR in half, basically. I'll remove it in a followup. I believe that follow up with have serialization changes so it'll feel pretty different than this PR.

Copy link
Member

Choose a reason for hiding this comment

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

Seems reasonable, thanks for explaining!

@nik9000 nik9000 merged commit b3a7728 into elastic:master Jan 14, 2020
@nik9000
Copy link
Member Author

nik9000 commented Jan 14, 2020

Thanks @not-napoleon!

nik9000 added a commit to nik9000/elasticsearch that referenced this pull request Jan 14, 2020
…0873)

We added a new rounding in elastic#50609 that handles offsets to the start and
end of the rounding so that we could support `offset` in the `composite`
aggregation. This starts moving `date_histogram` to that new offset.
nik9000 added a commit that referenced this pull request Jan 14, 2020
…50978)

We added a new rounding in #50609 that handles offsets to the start and
end of the rounding so that we could support `offset` in the `composite`
aggregation. This starts moving `date_histogram` to that new offset.
nik9000 added a commit to nik9000/elasticsearch that referenced this pull request Jan 17, 2020
I caused a serialization bug in elastic#50873. It is kind of tricky to get:
* Run a date_histogram aggregation
* On a shard on 7.6
* That shard doesn't return any results
* The coordinating node is before 7.6
nik9000 added a commit to nik9000/elasticsearch that referenced this pull request Jan 20, 2020
nik9000 added a commit to nik9000/elasticsearch that referenced this pull request Jan 20, 2020
…lastic#50873) (elastic#50978)"

This reverts commit 9a3d4db. It was
subtly broken in ways we didn't have tests for.
@nik9000
Copy link
Member Author

nik9000 commented Jan 20, 2020

I'm reverting this because it was subtly broken in ways we didn't have tests for. I'll make a PR that adds the tests and redoes it soon enough.

nik9000 added a commit to nik9000/elasticsearch that referenced this pull request Jan 20, 2020
…lastic#50873) (elastic#50978)"

This reverts commit 9a3d4db. It was
subtly broken in ways we don't have tests for.
nik9000 added a commit that referenced this pull request Jan 20, 2020
)

This reverts commit b3a7728. It had subtle bugs in things we don't have tests for.
nik9000 added a commit that referenced this pull request Jan 20, 2020
…50873) (#50978)" (#51240)

This reverts commit 9a3d4db. It was
subtly broken in ways we don't have tests for.
nik9000 added a commit that referenced this pull request Jan 21, 2020
…50873) (#50978)" (#51239)

This reverts commit 9a3d4db. It was
subtly broken in ways we didn't have tests for.
nik9000 added a commit to nik9000/elasticsearch that referenced this pull request Jan 21, 2020
SivagurunathanV pushed a commit to SivagurunathanV/elasticsearch that referenced this pull request Jan 23, 2020
We added a new rounding in elastic#50609 that handles offsets to the start and
end of the rounding so that we could support `offset` in the `composite`
aggregation. This starts moving `date_histogram` to that new offset.
nik9000 added a commit that referenced this pull request Jan 27, 2020
We added a new rounding in #50609 that handles offsets to the start and
end of the rounding so that we could support `offset` in the `composite`
aggregation. This starts moving `date_histogram` to that new offset.

This is a redo of #50873 with more integration tests.

This reverts commit d114c9d.
nik9000 added a commit to nik9000/elasticsearch that referenced this pull request Jan 27, 2020
)

We added a new rounding in elastic#50609 that handles offsets to the start and
end of the rounding so that we could support `offset` in the `composite`
aggregation. This starts moving `date_histogram` to that new offset.

This is a redo of elastic#50873 with more integration tests.

This reverts commit d114c9d.
nik9000 added a commit that referenced this pull request Jan 27, 2020
…51495)

We added a new rounding in #50609 that handles offsets to the start and
end of the rounding so that we could support `offset` in the `composite`
aggregation. This starts moving `date_histogram` to that new offset.

This is a redo of #50873 with more integration tests.

This reverts commit d114c9d.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants