Skip to content
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

Move top-level pipeline aggs out of QuerySearchResult #40319

Conversation

javanna
Copy link
Member

@javanna javanna commented Mar 21, 2019

As part of #40177 we have added top-level pipeline aggs to
InternalAggregations. Given that QuerySearchResult holds an
InternalAggregations instance, there is no need to keep on setting
top-level pipeline aggs separately. Top-level pipeline aggs can then
always be transported through InternalAggregations. Such change is
made in a backwards compatible manner.

As part of elastic#40177 we have added top-level pipeline aggs to
`InternalAggregations`. Given that `QuerySearchResult` holds an
`InternalAggregations` instance, there is no need to keep on setting
top-level pipeline aggs separately. Top-level pipeline aggs can then
always be transported through `InternalAggregations`. Such change is
made in a backwards compatible manner.
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo

@javanna
Copy link
Member Author

javanna commented Mar 21, 2019

run elasticsearch-ci/bwc

@javanna
Copy link
Member Author

javanna commented Mar 21, 2019

run elasticsearch-ci/default-distro

Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @javanna , I left one comment regarding a possible NPE.

pipelineAggregators = in.readNamedWriteableList(PipelineAggregator.class).stream().map(a -> (SiblingPipelineAggregator) a)
.collect(Collectors.toList());
//TODO update version after backport
if (in.getVersion().before(Version.V_8_0_0)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to check if hasAggs is true here because aggregations can be null.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes good catch

//TODO update version after backport
if (in.getVersion().before(Version.V_8_0_0)) {
List<SiblingPipelineAggregator> pipelineAggregators = in.readNamedWriteableList(PipelineAggregator.class).stream()
.map(a -> (SiblingPipelineAggregator) a).collect(Collectors.toList());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we skip the rewriting if siblings are empty ?

@javanna
Copy link
Member Author

javanna commented Mar 25, 2019

run elasticsearch-ci/2

@javanna
Copy link
Member Author

javanna commented Mar 25, 2019

@jimczi thanks for your comments, I addressed them, this should be good to go.

@javanna
Copy link
Member Author

javanna commented Mar 27, 2019

run elasticsearch-ci/2

@javanna
Copy link
Member Author

javanna commented Mar 27, 2019

run elasticsearch-ci/packaging-sample

@javanna
Copy link
Member Author

javanna commented Mar 28, 2019

run elasticsearch-ci/2

@javanna javanna merged commit b4d88aa into elastic:master Mar 28, 2019
jasontedor added a commit to rjernst/elasticsearch that referenced this pull request Mar 28, 2019
* master: (25 commits)
  [DOCS] Correct keystore commands for Email and Jira actions in Watcher (elastic#40417)
  [DOCS] Document common settings for snapshot repository plugins (elastic#40475)
  Remove with(out)-system-key tests (elastic#40547)
  Geo Point parse error fix (elastic#40447)
  Handle null retention leases in WaitForNoFollowersStep (elastic#40477)
  [DOCS] Adds anchors for ruby client (elastic#39867)
  Mute DataFrameAuditorIT#testAuditorWritesAudits
  Disable integTest when Docker is not available (elastic#40585)
  Add randomScore function in script_score query (elastic#40186)
  Test fixtures krb5 (elastic#40297)
  Correct ILM metadata minimum compatibility version (elastic#40569)
  SQL: Centralize SQL test dependencies version handling (elastic#40551)
  Mute testTracerLog
  Mute testHttpInput
  Include functions' aliases in the list of functions (elastic#40584)
  Optimise rejection of out-of-range `long` values (elastic#40325)
  Add docs for cluster.remote.*.proxy setting (elastic#40281)
  Migrate systemd packaging tests from bats to java (elastic#39954)
  Move top-level pipeline aggs out of QuerySearchResult (elastic#40319)
  Use openjdk 12 in packer cache script (elastic#40498)
  ...
javanna added a commit to javanna/elasticsearch that referenced this pull request Mar 29, 2019
As part of elastic#40177 we have added top-level pipeline aggs to
`InternalAggregations`. Given that `QuerySearchResult` holds an
`InternalAggregations` instance, there is no need to keep on setting
top-level pipeline aggs separately. Top-level pipeline aggs can then
always be transported through `InternalAggregations`. Such change is
made in a backwards compatible manner.
javanna added a commit that referenced this pull request Mar 29, 2019
As part of #40177 we have added top-level pipeline aggs to
`InternalAggregations`. Given that `QuerySearchResult` holds an
`InternalAggregations` instance, there is no need to keep on setting
top-level pipeline aggs separately. Top-level pipeline aggs can then
always be transported through `InternalAggregations`. Such change is
made in a backwards compatible manner.
javanna added a commit to javanna/elasticsearch that referenced this pull request Mar 29, 2019
gurkankaymak pushed a commit to gurkankaymak/elasticsearch that referenced this pull request May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants