Skip to content

Support BucketScript paths of type string and array.#44694

Merged
iverase merged 2 commits intoelastic:masterfrom
iverase:fixBucketScriptPath
Jul 23, 2019
Merged

Support BucketScript paths of type string and array.#44694
iverase merged 2 commits intoelastic:masterfrom
iverase:fixBucketScriptPath

Conversation

@iverase
Copy link
Contributor

@iverase iverase commented Jul 22, 2019

In #44385 the BucketScript parser was refactor to make it static. Unfortunately this action break some behaviour, in particular it is not able to parse paths defined as a String or an array. This PR gives back that ability.

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.

Left a minor comment, LGTM otherwise

.endObject()
.endObject();
BucketScriptPipelineAggregationBuilder builder1 = BucketScriptPipelineAggregationBuilder.parse("count", createParser(content));
assertEquals(builder1.getBucketsPaths().length , 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe check the content too ?

.endObject()
.endObject();
BucketScriptPipelineAggregationBuilder builder2 = BucketScriptPipelineAggregationBuilder.parse("count", createParser(content));
assertEquals(builder2.getBucketsPaths().length , 2);
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

@iverase
Copy link
Contributor Author

iverase commented Jul 22, 2019

@elasticmachine run elasticsearch-ci/1 elasticsearch-ci/2

@iverase
Copy link
Contributor Author

iverase commented Jul 22, 2019

@elasticmachine run elasticsearch-ci/2

1 similar comment
@iverase
Copy link
Contributor Author

iverase commented Jul 22, 2019

@elasticmachine run elasticsearch-ci/2

@tylersmalley
Copy link
Member

Thanks for putting this up. I will verify this also resolves our issue in Kibana.

@tylersmalley
Copy link
Member

Verified Kibana CI is passing with these changes: elastic/kibana#41701 (comment)

@iverase iverase merged commit 02ff060 into elastic:master Jul 23, 2019
iverase added a commit to iverase/elasticsearch that referenced this pull request Jul 23, 2019
@iverase iverase deleted the fixBucketScriptPath branch July 23, 2019 07:06
@iverase
Copy link
Contributor Author

iverase commented Jul 23, 2019

@tylersmalley Thanks for checking! PR has been merged in master and 7.x.

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