Skip to content

Implement queryDSL range support for exponential histograms#143379

Merged
JonasKunz merged 3 commits intoelastic:mainfrom
JonasKunz:exphisto-querydsl-range
Mar 6, 2026
Merged

Implement queryDSL range support for exponential histograms#143379
JonasKunz merged 3 commits intoelastic:mainfrom
JonasKunz:exphisto-querydsl-range

Conversation

@JonasKunz
Copy link
Copy Markdown
Contributor

@JonasKunz JonasKunz commented Mar 2, 2026

Implements the queryDSL range aggregation for exponential histograms. This is implemented very similar to how it is done for T-Digests: We assume that all points per bucket lie in the center of the bucket and are assigned a range based on that.

The code is also mostly copy pasted, with one core difference: When iterating the T-Digest centroids, we go through them sorted by the mean in ascending order. When we iterate through exponential histogram buckets, we iterate first from -0 to -Inf, and then from 0 to Inf. Because the algorithm does some binary search optimizations, it needed to be adapted for this.

@elasticsearchmachine elasticsearchmachine added v9.4.0 external-contributor Pull request authored by a developer outside the Elasticsearch team labels Mar 2, 2026
@JonasKunz JonasKunz marked this pull request as ready for review March 2, 2026 13:42
@JonasKunz JonasKunz requested a review from martijnvg March 2, 2026 13:42
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Mar 2, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

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

@nik9000
Copy link
Copy Markdown
Member

nik9000 commented Mar 2, 2026

@martijnvg, can you help with this one?

Copy link
Copy Markdown
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@JonasKunz JonasKunz merged commit 4312134 into elastic:main Mar 6, 2026
35 checks passed
spinscale pushed a commit to spinscale/elasticsearch that referenced this pull request Mar 6, 2026
sidosera pushed a commit to sidosera/elasticsearch that referenced this pull request Mar 6, 2026
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.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants