Clean up how pipeline aggs check for multi-bucket (backport of #54161) #54379
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_bucket
only 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,
MultiBucketAggregationBuilder
and it was fairly easy to forgetto implement the interface.
This replaces the marker interface with an abstract method in
AggregationBuilder
,bucketCardinality
which makes you returnNONE
,ONE
, orMANY
. Thebucket
aggregations can check forMANY
. Atthis point
ONE
andNONE
amount to about the same thing, but Isuspect that'll be a useful distinction when validating bucket sorts.
Closes #53215