-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Cumilative Sum doesn't work with other pipeline aggregations #27544
Comments
@simianhacker The server logs should contain a stack trace for that null pointer exception. Do you have it? |
Woops... forgot to add that... here you go:
|
Thanks. It looks like an NPE from unboxing a null, although that appears to only arise if an invalid aggregation path exception was swallowed previously. Can you take a look @colings86? |
I think this occurs because for an empty bucket (a bucket where the doc count is 0), the bucket_script is skipped and doesn't output anything for the bucket. This means that when the cumulative sum aggregator try to access the bucket script value for that bucket it can't find it (hence the invalid aggregation path) and null is returned. This issue relates to #27377 which is also caused because the value is not output in the bucket when the doc count is 0. |
… other aggregation
@elastic/es-search-aggs |
If the cusum agg encounters a null value, it's because the value is missing (like the first value from a derivative agg), the path is not valid, or the bucket in the path was empty. Previously cusum would just explode on the null, but this changes it so we only increment the sum if the value is non-null and finite. This is safe because even if the cusum encounters all null or empty buckets, the cumulative sum is still zero (like how the sum agg returns zero even if all the docs were missing values) I went ahead and tweaked AggregatorTestCase to allow testing pipelines, so that I could delete the IT test and reimplement it as AggTests. Closes elastic#27544
Fix NPE when CumulativeSum agg encounters null/empty bucket If the cusum agg encounters a null value, it's because the value is missing (like the first value from a derivative agg), the path is not valid, or the bucket in the path was empty. Previously cusum would just explode on the null, but this changes it so we only increment the sum if the value is non-null and finite. This is safe because even if the cusum encounters all null or empty buckets, the cumulative sum is still zero (like how the sum agg returns zero even if all the docs were missing values) I went ahead and tweaked AggregatorTestCase to allow testing pipelines, so that I could delete the IT test and reimplement it as AggTests. Closes #27544
If the cusum agg encounters a null value, it's because the value is missing (like the first value from a derivative agg), the path is not valid, or the bucket in the path was empty. Previously cusum would just explode on the null, but this changes it so we only increment the sum if the value is non-null and finite. This is safe because even if the cusum encounters all null or empty buckets, the cumulative sum is still zero (like how the sum agg returns zero even if all the docs were missing values) I went ahead and tweaked AggregatorTestCase to allow testing pipelines, so that I could delete the IT test and reimplement it as AggTests. Closes #27544
Cumulative sum aggregation returns an error when using it with other pipeline aggregations. This happens consistently with both bucket_scripts and derivatives.
Steps to Reproduce:
The text was updated successfully, but these errors were encountered: