-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
Inconsistent return value across metric aggregations between sum, avg, max, min with min_doc_count = 0 #31887
Comments
Here is a minimal reproduction for the scenario described above:
Elasticsearch 6.3.0 produces (output shortened):
As I am not sure whether this is intentional, can somebody in @elastic/es-search-aggs have a look and label it accordingly please? |
This is intentional: the sum of an empty set is well defined while the average is not (it is 0/0), likewise for min and max. I'd be curious to better understand what are the implications on the Kibana side. |
Just a note for posterity, |
@polyfractal |
The main thing here is not the possible values that an agg can return, but rather how the agg handles the empty set / no document scenario.
That's why Elasticsearch provides the values it does when the bucket is empty (
Yep, this is a known issue in Kibana (elastic/kibana#13356). It looks like the Kibana team just opened an issue independently to address this yesterday (elastic/kibana#17717), so it appears there's a plan in motion. |
es.version: 6.3.0
description:
With min_doc_count = 0, then
Metric Type sum return value '0'
Others[min/max/avg/mean] return value 'null'
if sum returns value '0', the empty bucket data will be mixed with the valid data value '0' in Kibana visualizations, and not sure the purpose of this design?
I know the sum is double type and the initial value is set as '0' and however it would be best if the return value can be null for the empty bucket as what you did in the min/max/avg aggregation types since value '0' is a real meaningful data from the time we have the negative numbers!
thanks!
The text was updated successfully, but these errors were encountered: