Fix broken parent and child aggregator#63811
Merged
nik9000 merged 1 commit intoelastic:masterfrom Oct 19, 2020
Merged
Conversation
In elastic#57892 I broke *some* sub-aggregations inside of the `parent` and `child` aggregator, specifically any sub-aggregations that do work in the `postCollect` phase. This fixes it by delaying the post collect phase of aggs under `parent` and `child` until `beforeBuildingBuckets` because, well, we haven't done *any* collection until after that phase.
Collaborator
|
Pinging @elastic/es-analytics-geo (:Analytics/Aggregations) |
nik9000
commented
Oct 16, 2020
| id: { "type": "keyword" } | ||
|
|
||
| - do: | ||
| index: |
Member
Author
There was a problem hiding this comment.
I was borrowing this test setup and wanted to clean it up a bit while I was here. bulk is ever so slightly quicker for this sort of thing. And it takes up a lot fewer lines!
| --- | ||
| "unconfigured": | ||
| - do: | ||
| index: |
Member
Author
There was a problem hiding this comment.
I moved this into 40_aggregations.yml.
| */ | ||
| @Override | ||
| public final void postCollection() throws IOException { | ||
| public void postCollection() throws IOException { |
Member
Author
There was a problem hiding this comment.
I think we'd be better off removing postCollection entirely and replacing it with beforeBuildingBuckets because it is very similar but it has access to the buckets we actually want.
Member
Author
|
Thanks @not-napoleon ! |
nik9000
added a commit
to nik9000/elasticsearch
that referenced
this pull request
Oct 19, 2020
In elastic#57892 I broke *some* sub-aggregations inside of the `parent` and `child` aggregator, specifically any sub-aggregations that do work in the `postCollect` phase. This fixes it by delaying the post collect phase of aggs under `parent` and `child` until `beforeBuildingBuckets` because, well, we haven't done *any* collection until after that phase.
nik9000
added a commit
to nik9000/elasticsearch
that referenced
this pull request
Oct 19, 2020
In elastic#57892 I broke *some* sub-aggregations inside of the `parent` and `child` aggregator, specifically any sub-aggregations that do work in the `postCollect` phase. This fixes it by delaying the post collect phase of aggs under `parent` and `child` until `beforeBuildingBuckets` because, well, we haven't done *any* collection until after that phase.
nik9000
added a commit
that referenced
this pull request
Oct 19, 2020
In #57892 I broke *some* sub-aggregations inside of the `parent` and `child` aggregator, specifically any sub-aggregations that do work in the `postCollect` phase. This fixes it by delaying the post collect phase of aggs under `parent` and `child` until `beforeBuildingBuckets` because, well, we haven't done *any* collection until after that phase.
nik9000
added a commit
that referenced
this pull request
Oct 19, 2020
In #57892 I broke *some* sub-aggregations inside of the `parent` and `child` aggregator, specifically any sub-aggregations that do work in the `postCollect` phase. This fixes it by delaying the post collect phase of aggs under `parent` and `child` until `beforeBuildingBuckets` because, well, we haven't done *any* collection until after that phase.
nik9000
added a commit
to nik9000/elasticsearch
that referenced
this pull request
Oct 21, 2020
After elastic#63811 it became clear to me that `postCollect` is kind of dangerous and not all that useful. So this removes it. The trouble with `postCollect` is that it all happened right after we finished calling `collect` on the `LeafBucketCollectors` but before we built the aggregation results. But in elastic#63811 we found out that we can't call `postCollect` on the children of `parent` or `child` aggregators until we know which *which* aggregation results we're building. So this removes `postCollect` and moves all of the things we did at post-collect phase into `buildAggregations` or into hooks called in those methods.
nik9000
added a commit
that referenced
this pull request
Oct 28, 2020
After #63811 it became clear to me that `postCollect` is kind of dangerous and not all that useful. So this removes it. The trouble with `postCollect` is that it all happened right after we finished calling `collect` on the `LeafBucketCollectors` but before we built the aggregation results. But in #63811 we found out that we can't call `postCollect` on the children of `parent` or `child` aggregators until we know which *which* aggregation results we're building. So this removes `postCollect` and moves all of the things we did at post-collect phase into `buildAggregations` or into hooks called in those methods.
nik9000
added a commit
to nik9000/elasticsearch
that referenced
this pull request
Oct 28, 2020
After elastic#63811 it became clear to me that `postCollect` is kind of dangerous and not all that useful. So this removes it. The trouble with `postCollect` is that it all happened right after we finished calling `collect` on the `LeafBucketCollectors` but before we built the aggregation results. But in elastic#63811 we found out that we can't call `postCollect` on the children of `parent` or `child` aggregators until we know which *which* aggregation results we're building. So this removes `postCollect` and moves all of the things we did at post-collect phase into `buildAggregations` or into hooks called in those methods.
nik9000
added a commit
that referenced
this pull request
Oct 29, 2020
After #63811 it became clear to me that `postCollect` is kind of dangerous and not all that useful. So this removes it. The trouble with `postCollect` is that it all happened right after we finished calling `collect` on the `LeafBucketCollectors` but before we built the aggregation results. But in #63811 we found out that we can't call `postCollect` on the children of `parent` or `child` aggregators until we know which *which* aggregation results we're building. So this removes `postCollect` and moves all of the things we did at post-collect phase into `buildAggregations` or into hooks called in those methods.
61 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In #57892 I broke some sub-aggregations inside of the
parentandchildaggregator, specifically any sub-aggregations that do work inthe
postCollectphase. This fixes it by delaying the post collectphase of aggs under
parentandchilduntilbeforeBuildingBucketsbecause, well, we haven't done any collection until after that phase.