-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
HLRC support for string_stats #52163
Conversation
This adds a builder and parsed results for the `string_stats` aggregation directly to the high level rest client. Without this the HLRC can't access the `string_stats` API without the elastic licensed `analytics` module. While I'm in there this adds a few of our usual unit tests and modernizes the parsing.
Pinging @elastic/es-analytics-geo (:Analytics/Aggregations) |
This is a work in progress because I don't have the horsepower to run all the tests at the moment. So I'm making Jenkins do it. I think this is how I want to expose analytics aggs to the HLRC, though the hack with the builder is unfortunate. |
I've removed |
the test wants it.....
@imotov you mentioned a while back that you were interested in talking about HLRC support for the analytics aggs. This is my take on explicit support for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice! Even though that doesn't solve an issue with AggregationBuilders.stringStats()
method, but I think it is a good step forward.
Map<String, Long> charOccurrences = instance.getCharOccurrences(); | ||
boolean showDistribution = instance.getShowDistribution(); | ||
switch (between(0, 6)) { | ||
case 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That indentation looks a bit strange to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is the true indentation for case statements!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is indeed, we just don't use it anywhere else :) that's why it looks strange.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is the Eclipse standard but not the intellij standard. I prefer this was but I'm not picky.
import static org.hamcrest.Matchers.equalTo; | ||
import static org.hamcrest.Matchers.hasEntry; | ||
|
||
public class StringStatsIT extends ESRestHighLevelClientTestCase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wonder if we should rename this to AnalyticsAggsIT
or something like this, so we can add other agg tests from analytics plugin here as we add convert them to work with the rest client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
Do you think we should move |
Like, as part of a separate change. Not this one. |
That's the challenge |
+2 |
This adds a builder and parsed results for the `string_stats` aggregation directly to the high level rest client. Without this the HLRC can't access the `string_stats` API without the elastic licensed `analytics` module. While I'm in there this adds a few of our usual unit tests and modernizes the parsing.
This adds a builder and parsed results for the `string_stats` aggregation directly to the high level rest client. Without this the HLRC can't access the `string_stats` API without the elastic licensed `analytics` module. While I'm in there this adds a few of our usual unit tests and modernizes the parsing.
Thanks @imotov ! |
This adds a builder and parsed results for the
string_stats
aggregation directly to the high level rest client. Without this the
HLRC can't access the
string_stats
API without the elastic licensedanalytics
module.While I'm in there this adds a few of our usual unit tests and
modernizes the parsing.