-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Continue realizing sorting by aggregations #52298
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
Conversation
This drops more of the `instanceof`s from `AggregationPath`. There are still a couple in `AggregationPath`. And I ended up moving two into `BucketsAggregator`, but I think this is still an improvement!
|
|
||
| @Override | ||
| public Aggregator resolveSortPath(AggregationPath.PathElement next, Iterator<AggregationPath.PathElement> path) { | ||
| if (this instanceof SingleBucketAggregator) { |
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.
I'm not super thrilled about this, but it is how it used to work and I wanted to keep this change fairly contained.
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.
👍
| * that sort path itself can't contain a different {@code terms} | ||
| * aggregation. | ||
| */ | ||
| public final Aggregator resolveSortPathOnValidAgg(AggregationPath.PathElement next, Iterator<AggregationPath.PathElement> path) { |
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.
I'm not super comfortable with this name, but I think it'll fall away in a followup change. When I dig into that last instanceof in resolveTopmostAggregator.
|
Pinging @elastic/es-analytics-geo (:Analytics/Aggregations) |
polyfractal
left a comment
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.
Apologies for the delay. ++, this is indeed cleaner than a big monolithic blob of checks :)
|
|
||
| @Override | ||
| public Aggregator resolveSortPath(AggregationPath.PathElement next, Iterator<AggregationPath.PathElement> path) { | ||
| if (this instanceof SingleBucketAggregator) { |
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.
👍
This drops more of the `instanceof`s from `AggregationPath`. There are still a couple in `AggregationPath`. And I ended up moving two into `BucketsAggregator`, but I think this is still an improvement!
|
Thanks @polyfractal ! |
This reverts commit 5659e72. It causes some test failures that didn't come up in the PR tests.
|
I've reverted this because it caused a test failure that we didn't catch in the PR tests. I'll dig on Monday. |
This reverts commit b3afbe7 which reverted #53398 because we encountered a test failure after merging that hadn't shown up before. Sneaky!
…astic#52682) This reverts commit b3afbe7 which reverted #53398 because we encountered a test failure after merging that hadn't shown up before. Sneaky!
This drops more of the
instanceofs fromAggregationPath. There arestill a couple in
AggregationPath. And I ended up moving two intoBucketsAggregator, but I think this is still an improvement!