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
Weird response with range agg on float field #81749
Comments
Pinging @elastic/es-analytics-geo (Team:Analytics) |
Maybe this is a consequence of #78932? |
I tried to reproduce the issue with two unit tests...one using floats and one using doubles. It looks like that using doubles, keys are "correct" ("5.0-6.0" and "6.0-10.6"), while they are not when using floats. |
Keys derived from float values seem incorrect due to some rounding issue and they do not always match the original ranges as specified in the aggregation query. Ideally the user expects keys in the response to match ranges in the request. When using double values, keys match expected values. These testsq covers a bug reported in elastic#81749.
The idea is to generate the key using the `from` and `to` values from double values instead of using the stored float values. The stored float values can still be used for all bucket comparisons. This fix addresees issue elastic#81749.
All tests are green now. I will proceed with the backporting as soon as the review is completed. Will try to follow-up on this with the team so that maybe we can have a fix merged on Monday or Tuesday. I will backport this to: 7.16, 7.17 and 8.0. |
Back porting to 7.17 and 8.0.0 is enough. |
We got the same issue in elasticsearch:7.16.2. |
I have this issue too. Strangely, if I use a range of |
Back-porting to version |
Closing this as a result of merging the fix in #81801 and back-porting the fix to version |
Description of the problem
We found a bug that is easy to reproduce it in kibana with Lens ranges on float field.
Specifically we created a float field and we apply the range aggregation on it. The request looks like that:
You can see that the requested ranges have decimal numbers.
The response we get though seems like that:
You can see that the second bucket is not the same with the response.
Elasticsearch version (
bin/elasticsearch --version
):7.16
Steps to reproduce:
In 7.15.2 this worked fine. I think it was introduced in 7.16. (I replicated in a 7.16.1 instance)
The text was updated successfully, but these errors were encountered: