elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
1.02k stars 24.82k forks source link

AutoDateHistogram should not merge buckets with a final reduce context #62731

Open jimczi opened 4 years ago

jimczi commented 4 years ago

The AutoDateHistogram can perform final reduce multiple times when it needs to merge buckets together. If a terms aggregation is nested under an auto-date histogram, running multiple final reduce may result in a loss of precision since each final reduce will prune the list of terms prematurely. So if the terms aggregation is sorted by count, the counts and ordering of the terms within the bucket may be wrong due to the merges that the auto-date histogram performed. We should add the ability to run partial reduce as part of a final reduce in order to allow the merging of buckets in any parent aggregation. That would allow the terms aggregation to preserve all buckets when merging parent buckets incrementally in the auto-date histogram.

elasticmachine commented 4 years ago

Pinging @elastic/es-analytics-geo (:Analytics/Geo)

elasticsearchmachine commented 11 months ago

Pinging @elastic/es-analytics-geo (Team:Analytics)