Skip to content

Conversation

@nik9000
Copy link
Member

@nik9000 nik9000 commented Feb 13, 2020

This drops more of the instanceofs 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!

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) {
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'm not super thrilled about this, but it is how it used to work and I wanted to keep this change fairly contained.

Copy link
Contributor

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) {
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'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.

@elasticmachine
Copy link
Collaborator

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

Copy link
Contributor

@polyfractal polyfractal left a 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) {
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@nik9000 nik9000 merged commit 5659e72 into elastic:master Feb 21, 2020
nik9000 added a commit to nik9000/elasticsearch that referenced this pull request Feb 21, 2020
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!
@nik9000
Copy link
Member Author

nik9000 commented Feb 21, 2020

Thanks @polyfractal !

nik9000 added a commit that referenced this pull request Feb 21, 2020
This reverts commit 5659e72.

It causes some test failures that didn't come up in the PR tests.
@nik9000
Copy link
Member Author

nik9000 commented Feb 21, 2020

I've reverted this because it caused a test failure that we didn't catch in the PR tests. I'll dig on Monday.

nik9000 added a commit to nik9000/elasticsearch that referenced this pull request Feb 23, 2020
This reverts commit b3afbe7 which
reverted #53398 because we encountered a test failure after merging that
hadn't shown up before. Sneaky!
nik9000 added a commit that referenced this pull request Feb 23, 2020
This reverts commit b3afbe7 which
reverted #53398 because we encountered a test failure after merging that
hadn't shown up before. Sneaky!
nik9000 added a commit to nik9000/elasticsearch that referenced this pull request Feb 23, 2020
…astic#52682)

This reverts commit b3afbe7 which
reverted #53398 because we encountered a test failure after merging that
hadn't shown up before. Sneaky!
nik9000 added a commit that referenced this pull request Feb 23, 2020
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!
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.

4 participants