Skip to content

Conversation

JonasKunz
Copy link
Contributor

Part of #135625. Adds support for the histogram aggregation on exponential_histogram fields.

The implementation uses the same assumption as the percentiles and rank algorithms: For each histogram bucket, all values lie on a single point. (see #136354).

The implementation was mostly copied from the existing T-Digest implementation.

@elasticsearchmachine elasticsearchmachine added external-contributor Pull request authored by a developer outside the Elasticsearch team v9.3.0 labels Oct 21, 2025
@JonasKunz JonasKunz marked this pull request as ready for review October 22, 2025 08:09
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Oct 22, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

if (values.advanceExact(doc)) {
ExponentialHistogram histo = values.histogramValue();
forEachBucketCenter(histo, (center, count) -> {
double clampedCenter = Math.clamp(center, histo.min(), histo.max());
Copy link
Member

Choose a reason for hiding this comment

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

Maybe clamp in forEachBucketCenter?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/Aggregations Aggregations external-contributor Pull request authored by a developer outside the Elasticsearch team >non-issue Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants