Allow Bucket Script aggregation to reference on null #37862
Labels
:Analytics/Aggregations
Aggregations
:Core/Infra/Scripting
Scripting abstractions, Painless, and Mustache
>enhancement
related to #36642
related to #31920
Example:
If, in this example, number of
child
elements are zero, the AvgAggregation can't be performed (as averaging of zero elements is impossible). Thataveraged
aggregation will returnnull
.But this null will silentry break the
some-metric
. In the final result,some-metric
won't just appear (without any error).I think it's a good thing to be able to handle these case inside the script. For example:
In case if this null is not handled - elastic can just return an error
The text was updated successfully, but these errors were encountered: