Clean up how pipeline aggs check for multi-bucket (backport of #54161)#54379
Merged
nik9000 merged 4 commits intoelastic:7.xfrom Mar 30, 2020
Merged
Clean up how pipeline aggs check for multi-bucket (backport of #54161)#54379nik9000 merged 4 commits intoelastic:7.xfrom
nik9000 merged 4 commits intoelastic:7.xfrom
Conversation
…c#54161) Pipeline aggregations like `stats_bucket`, `sum_bucket`, and `percentiles_bucket` only operate on buckets that have multiple buckets. This adds support for those aggregations to `geo_distance`, `ip_range`, `auto_date_histogram`, and `rare_terms`. This all happened because we used a marker interface to mark compatible aggs, `MultiBucketAggregationBuilder` and it was fairly easy to forget to implement the interface. This replaces the marker interface with an abstract method in `AggregationBuilder`, `bucketCardinality` which makes you return `NONE`, `ONE`, or `MANY`. The `bucket` aggregations can check for `MANY`. At this point `ONE` and `NONE` amount to about the same thing, but I suspect that'll be a useful distinction when validating bucket sorts. Closes elastic#53215
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.
Pipeline aggregations like
stats_bucket,sum_bucket, andpercentiles_bucketonly operate on buckets that have multiple buckets.This adds support for those aggregations to
geo_distance,ip_range,auto_date_histogram, andrare_terms.This all happened because we used a marker interface to mark compatible
aggs,
MultiBucketAggregationBuilderand it was fairly easy to forgetto implement the interface.
This replaces the marker interface with an abstract method in
AggregationBuilder,bucketCardinalitywhich makes you returnNONE,ONE, orMANY. Thebucketaggregations can check forMANY. Atthis point
ONEandNONEamount to about the same thing, but Isuspect that'll be a useful distinction when validating bucket sorts.
Closes #53215