-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Add more flexibility to MovingFunction window alignment #44360
Conversation
@polyfractal, check this out. |
There is a serialization of |
We can allow specifying special |
Pinging @elastic/es-analytics-geo |
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.
Particularly, I'm not entirely sure how the result should look like when the window moves outside the borders.
Checking my understanding: the current behavior is to "clamp" to the available values in the window, correct? So as the window approaches the edge, the actual window of values offered to the function shrinks? E.g. there is no "padding" once the window goes past the values (on either side).
I think that's the correct choice. I dont think we want to introduce padding, or circularizing like is done with FFT. Too complicated, unintuitive. Clamping seems reasonable to me.
There is a serialization of MovFnPipelineAggregator values. Do we need cross-version compatibility this time?
Afraid so. :( We'll need to put version gates on the serialization, and handle the case where we are talking to old nodes that don't serialize shift
(setting shift = 0
in that case)
We can allow specifying special shift values using descriptive names.
Hmm, good question. I'm leaning towards "no", and just use the numeric shift
parameter. Simpler that way and as much flexibility as a user wants.
...er/src/main/java/org/elasticsearch/search/aggregations/pipeline/MovFnPipelineAggregator.java
Outdated
Show resolved
Hide resolved
What if we're writing to an old node and |
Yeah, in these cases we assume the old behavior, so here we'd just avoid sending Heterogeneous clusters are assumed to be short-lived and only during rolling upgrades, so with regards to bwc in mixed clusters we just try not to break things while in that mixed state. Since pipelines are only executed on the coordinating node, the behavior will depend on if the query lands on a new or old node. Serialization is needed because they go out with the full agg tree, but the execution only happens on the coordinator. |
Ready for review. |
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.
Left a few comments, but otherwise LGTM! Will kick off a CI build after the last commit. Thanks!
...ain/java/org/elasticsearch/search/aggregations/pipeline/MovFnPipelineAggregationBuilder.java
Outdated
Show resolved
Hide resolved
...er/src/main/java/org/elasticsearch/search/aggregations/pipeline/MovFnPipelineAggregator.java
Show resolved
Hide resolved
@elasticmachine test this please |
Sorry for the delay, was out on holiday last week. Not sure why CI got stuck like that, going to trigger another build. @elasticmachine test this please |
Maybe I need to merge with master? |
++ Let's merge in master, that tends to resolve unrelated failures :) |
@elasticmachine test this please |
Hmm, ILM @elasticmachine run elasticsearch-ci/bwc |
Failed again. This time it's a different error. |
Bleh, that's an artifact from the version bump yesterday. Gonna merge master and start again. Sorry, it's not normally this tough to get a green CI :( |
@elasticmachine update branch |
@elasticmachine test this please |
🎉 merging! Thanks @Hohol :) |
Introduce shift field to MovingFunction aggregation. By default, shift = 0. Behavior, in this case, is the same as before. Increasing shift by 1 moves starting window position by 1 to the right. To simply include current bucket to the window, use shift = 1 For center alignment (n/2 values before and after the current bucket), use shift = window / 2 For right alignment (n values after the current bucket), use shift = window.
…)" This reverts commit 1a58a48.
Introduce shift field to MovingFunction aggregation. By default, shift = 0. Behavior, in this case, is the same as before. Increasing shift by 1 moves starting window position by 1 to the right. To simply include current bucket to the window, use shift = 1 For center alignment (n/2 values before and after the current bucket), use shift = window / 2 For right alignment (n values after the current bucket), use shift = window.
Addresses elastic/elasticsearch#44360 (cherry picked from commit 6e121ef)
Introduce
shift
field toMovingFunction
aggregation.By default,
shift = 0
. Behavior, in this case, is the same as before.Increasing
shift
by1
moves starting window position by1
to the right.shift = 1
n/2
values before and after the current bucket), useshift = window / 2
shift = window
.Closes #42181