-
Notifications
You must be signed in to change notification settings - Fork 242
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
Java client and direct CURL call do not return the same result #843
Comments
Hello! |
Hello again! |
Hello! |
Update: in the end we realized that it would just be easier to just box the numbers and change the field from the primitive type to the object, so in this case from |
Bump on this^ Lines 142 to 147 in f2f79a6
|
Hello again, after drafting the solution we came to the conclusion that the changes are too impactful to be released with the next minor version, especially because they won't result in a compiler error: the type of the various aggregations result will be changed from the java primitive type to the corresponding Object, meaning with no null checks users will incur in unexpected NullPointerExceptions. Because of this, we will be waiting until the next major version of the java client (9.0.0) to release this fix, together with instructions on how to modify the code accordingly, especially for those users who followed our advice and were comparing the "zero" result to the doc count to check if the returned "zero" was originally a json "null". Sorry again for the delay, if there were any simple workaround we would have implemented it ASAP, but currently this is the only way we can proceed. |
Hey @l-trotta! thanks a lot for the update. I agree with the fact that the silent break this change ( |
@Priyadarshanvijay unfortunately that would still be a silent breaking change for all the users who are checking for 0 and would have to switch to checking for NaN. The only non breaking way would be to add some boolean method to the response, like |
@l-trotta I agree with that, but the current implementation seems incorrect and as a consequence, unusable for aggregations. I would argue that the current behavior is also a "silent-break" for clients which upgraded from older versions of ES ( <= ES 7.x ) since they would expect the aggregations to work in the same way, which they do on the server side, but the java client misrepresents them while deserialization. |
Java API client version
8.13.3
Java version
17.0.11
Elasticsearch Version
8.14.1
Problem description
We do a GeoTile Grid aggregation with two average aggregations.
The curl call and the client java do not return the same json result for the buckets.
Below the curl version response:
And the java client version response:
All the documents in the 10/455/466 grid have no value for AOD566 property.
With CURL the result of the average on this property is null and with the java client the result is 0.0.
There is a way to obtain the result of the curl with the java client ?
The text was updated successfully, but these errors were encountered: