Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sum aggregation in single shard of index for long field type precision problem #50503

Open
hackerwin7 opened this issue Dec 27, 2019 · 5 comments
Labels
:Analytics/Aggregations Aggregations >enhancement :Search/Search Search-related issues that do not fall into other categories Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:Search Meta label for search team

Comments

@hackerwin7
Copy link

hackerwin7 commented Dec 27, 2019

Elasticsearch version:
6.3.1, 7.5.1

Plugins installed: []

JVM version (java -version):
12.0.2
OS version (uname -a if on a Unix-like system):
Debian 4.14.81.bm.15

Description of the problem including expected versus actual behavior:

In a single shard of index, when doing a simple sum aggregation for a long mapping type field, if the sum result is huge, it will loose the precision.

Elasticsearch sum aggregation use double to sum the value with kahan summation in SumAggregator, when corrected is very small in contrast to sum, then the double newSum = sum + corrected; will loose the precision, even though the field mapping type of index is long.

@astefan astefan added the :Search/Search Search-related issues that do not fall into other categories label Dec 27, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/Search)

@GrayMissing
Copy link

GrayMissing commented Dec 28, 2019

I think it's about NumericMetricsAggregation interface design, as it take double as its value, double can't ensure to precisely represent a big integer number greater than 2^53

@hackerwin7
Copy link
Author

I think it's about NumericMetricsAggregation interface design, as it take double as its value, double can't ensure to precisely represent a big integer number greater than 2^53

Yes,all numeric metrics for aggregation would use double style to process

@elasticmachine
Copy link
Collaborator

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

@rjernst rjernst added Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:Search Meta label for search team labels May 4, 2020
@csoulios
Copy link
Contributor

csoulios commented Sep 9, 2020

This ticket is discussed further in PR #50538.

Relates to #9545, #46934 and #60149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Aggregations Aggregations >enhancement :Search/Search Search-related issues that do not fall into other categories Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:Search Meta label for search team
Projects
None yet
Development

No branches or pull requests

8 participants