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

Add more flexibility to MovingFunction window alignment #42181

Closed
polyfractal opened this issue May 16, 2019 · 3 comments · Fixed by #44360
Closed

Add more flexibility to MovingFunction window alignment #42181

polyfractal opened this issue May 16, 2019 · 3 comments · Fixed by #44360

Comments

@polyfractal
Copy link
Contributor

Today, the moving function pipeline aggregation operates in a "left-aligned" exclusive mode; the window that is offered for calculation is the last n values excluding the current bucket.

It's not uncommon to want the window to be inclusive (include the current bucket's value in the window). Other alignments are also useful, such as center (n/2 values before and after the current bucket) and right (n values after the current bucket).

I'm not entirely sure how we should expose these options in the API, but it would be helpful if we can provide more flexibility here.

Relates to #20667

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo

@jcornez
Copy link

jcornez commented May 17, 2019

Thanks for this.

I'd also like to refer to #23874. That issue is strictly speaking distinct. But they are related in that you often want to use bucket_selector when you are using a moving function. So if your moving window is 10 days (assuming date_historgram with 1d interval), then you want to skip the first 9 (if the moving_fn is inclusive) or 10 (if not) days of the window. Referring to the bucket_key would be one way to do this. Another would simply be to index the buckets.

Like I say, not related to window alignment, but more generally to the ease and utility of moving_fn - which is a common them for both. Thanks.

@polyfractal polyfractal added the help wanted adoptme label Jul 12, 2019
@Hohol
Copy link
Contributor

Hohol commented Jul 15, 2019

I'd like to take this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants