Skip to content

Conversation

@nik9000
Copy link
Member

@nik9000 nik9000 commented Mar 28, 2020

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 #53215

…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
@nik9000 nik9000 merged commit e58ad9f into elastic:7.x Mar 30, 2020
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.

1 participant