-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Feature gap between Java and HTTP APIs for Percentiles aggregation #23610
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
Comments
@mrec thanks for your feedback. You are right that this might be one of the cases where it will be hard to provide the same functionality that we currently have in the Java API when going through the REST layer. @javanna i will label this accordingly so we can track this when we get to parsing the aggregations on the client side. |
Thanks for opening this @mrec . Good find, the transport client ends up exposing internal objects and state that is not available otherwise through REST. Once you move to REST, we will only be able to return what we get back via the REST layer, hence the java REST client will only return what all the other REST language clients do. We are making the effort to reuse the same request and response objects as the transport client to ease migration, but we will not be able to return part of objects that are not returned through REST. In particular for aggregations, we are reusing the interfaces and adding client classes that implement the same interfaces. I understand that you are casting to the internal object at the moment in your application; once you'll move to the high level REST client that cast will throw I don't think I can do more than acknowledging this issue and closing it. Those internal objects are exposed as a side-effect of using the same code for internal stuff and the Java api, something that we have been addressing by developing a Java REST client. |
I'm not sure what interface you'll be reusing in this case. I suspect the root problem here is that |
Of course some casting will be needed, |
This is a pretty minor edge case, but the blog post on retiring the old Java API asks for feedback and this is something we ran into recently. (In 2.3.2, though I don't think anything's changed in later versions.)
In the HTTP API, when you request e.g.
[25, 50, 75]
percentiles, all you get back is exactly that. In the Java API, on the other hand, you get back a serializedInternalTDigestPercentiles
which can be queried for the specific percentiles you requested, but also for any other percentile you might be interested in.We use Percentiles in a calibration request to find bucket boundaries for a subsequent Range aggregation, and this becomes relevant when you have a very skewed distribution swamped by a single value, so that the
[25, 50, 75]
percentiles might all be the same value. Since the Range agg is driving faceted drilldown UI and a single-bucket navigator is pretty pointless, in this case we use theInternalTDigestPercentiles
to binary-chop around until we find some useful bucket boundaries. AIUI this would no longer be possible with the HTTP API.It's not the end of the world; one alternative considered was requesting a lot more percentiles up front to improve our chances of getting 3 different ones, and that wouldn't depend on the API. In a perfect world there'd be a Range variant for "N optimally-balanced buckets" instead of for explicit bucket boundaries, which would do away with the need for the extra calibration round-trip, but that's probably wishful thinking.
The text was updated successfully, but these errors were encountered: