When scalar addition encounters an integer overflow, it sets the value to null and adds a warning. When the SUM aggregation encounters an integer overflow, it crashes the query and returns a 500. This is also the root cause of https://github.com/elastic/elasticsearch/issues/99575, as the AVG surrogates to SUM and COUNT.
Steps to Reproduce
Create an index with a long field and to documents with MAX_LONG as their value:
Elasticsearch Version
main
Installed Plugins
No response
Java Version
bundled
OS Version
na
Problem Description
When scalar addition encounters an integer overflow, it sets the value to null and adds a warning. When the SUM aggregation encounters an integer overflow, it crashes the query and returns a 500. This is also the root cause of https://github.com/elastic/elasticsearch/issues/99575, as the AVG surrogates to SUM and COUNT.
Steps to Reproduce
Create an index with a long field and to documents with MAX_LONG as their value:
Attempt to aggregate the sum of those documents
Expected Response:
Actual Response:
Logs (if relevant)
No response