-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Bug fix to allow access to top level params in reduce script #42096
Conversation
Pinging @elastic/es-analytics-geo |
@elasticmachine run elasticsearch-ci/2 |
@elasticmachine run elasticsearch-ci/bwc |
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.
LGTM
@@ -72,6 +72,8 @@ | |||
Collections.singletonMap("itemValue", 12)); | |||
private static final Script COMBINE_SCRIPT_PARAMS = new Script(ScriptType.INLINE, MockScriptEngine.NAME, "combineScriptParams", | |||
Collections.singletonMap("divisor", 4)); | |||
private static final Script REDUCE_SCRIPT_AGG_PARAMS = new Script(ScriptType.INLINE, MockScriptEngine.NAME, "reduceScriptAggParams", |
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.
Can this be named without "agg" like the similar constants here?
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.
Good catch. Fixed.
@rjernst Thanks for the review! Will commit as soon as CI passes. |
@elasticmachine test this please |
@elasticmachine run elasticsearch-ci/1 |
@elasticmachine run elasticsearch-ci/1 |
Parameters specified for use in all scripts within a metric aggregation were never merged into reduce scripts as described in this issue (#42046). This fix merges top-level parameters for a metric aggregation into reduce script parameters.