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 multi-level breadth-first aggregations. #10411
Merged
Merged
Conversation
This file contains 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
@colings86 Would you mind reviewing this change? |
} | ||
context.aggregations().aggregators(aggregators); | ||
final BucketCollector collector = BucketCollector.wrap(collectors); | ||
collector.preCollection(); |
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 the these two lines not be put inside of the if statement so we don't create the wrapper unless we are going to use it?
@jpountz left some comments |
@colings86 Pushed a new commit |
LGTM |
jpountz
force-pushed
the
fix/multi_level_breadth_first
branch
from
April 9, 2015 10:05
9af63f4
to
978724f
Compare
The refactoring in elastic#9544 introduced a regression that broke multi-level aggregations using breadth-first. This was due to sub-aggregators creating deferred collectors before their parent aggregator and then the parent aggregator trying to collect sub aggregators directly instead of going through the deferred wrapper. This commit fixes the issue but we should try to simplify all the pre/post collection logic that we have. Also `breadth_first` is now automatically ignored if the sub aggregators need scores (just like we ignore `execution_mode` when the value does not make sense like using ordinals on a script). Close elastic#9823
jpountz
force-pushed
the
fix/multi_level_breadth_first
branch
from
April 9, 2015 10:06
978724f
to
6b16b32
Compare
jpountz
added a commit
that referenced
this pull request
Apr 9, 2015
Aggregations: Fix multi-level breadth-first aggregations. Close #10411
clintongormley
changed the title
Aggregations: Fix multi-level breadth-first aggregations.
Fix multi-level breadth-first aggregations.
Jun 8, 2015
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.
The refactoring in #9544 introduced a regression that broke multi-level
aggregations using breadth-first. This was due to sub-aggregators creating
deferred collectors before their parent aggregator and then the parent
aggregator trying to collect sub aggregators directly instead of going through
the deferred wrapper.
This commit fixes the issue but we should try to simplify all the pre/post
collection logic that we have.
Also
breadth_first
is now automatically ignored if the sub aggregators needscores (just like we ignore
execution_mode
when the value does not make senselike using ordinals on a script).
Close #9823