-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Bucket script aggregation throws NPE if script returns null #32790
Comments
Pinging @elastic/es-search-aggs |
I'm not sure the fact you could return |
@rjernst sure on it shortly :) |
@rjernst hmm supporting this kinda messes with the plan of improving performance by returning I guess if we want to continue supporting this we will have to go back (a little) to returning |
I think we should return
|
This is a ml/beats use case where the query is used in a template job configuration. Not allowing |
How about: I'll make it return |
* As explained in elastic#32790, `BucketAggregationScript` must support `null` as a return value * Closes elastic#32790
Fix incoming in #32811 |
* As explained in elastic#32790, `BucketAggregationScript` must support `null` as a return value * Closes elastic#32790
First some justification as the title suggests this should be expected:
I have a monotonic counter
bytes_in
say that figure comes from a network interface and I wish to use the derivative aggregation to find the increase per bucket. However, my counter is a 32 bit number and occasionally it overflows wrapping back to 0 at which point the derivate is a large negative number. I can filter out the misleading derivatives with the scriptparams.bytes >= 0 ? params.bytes : null
and by settinggap_policy: skip
the negative derivative should be skipped.The error occurs on master not 6.4 or earlier and appears to be a regression.
Reproduce
First index a couple of records the last of which has the wrapped counter
Then query
Returns
And the relevant log
The text was updated successfully, but these errors were encountered: