apache / arrow

Apache Arrow is the universal columnar format and multi-language toolbox for fast data interchange and in-memory analytics
https://arrow.apache.org/
Apache License 2.0
14.59k stars 3.54k forks source link

[R] Any support for rolling windows functions? #36849

Open DavisVaughan opened 1 year ago

DavisVaughan commented 1 year ago

Describe the enhancement requested

i.e. functions like rolling mean, min, max, etc.

In https://github.com/r-lib/slider/issues/195 I got a request for rolling window functions to work with arrow backends. I have a feeling the way that would work (if it existed) was for arrow to translate something like mutate(df, mean = slide_mean(col, before = 3)) internally to something the C++ engine understands.

But I'm not sure if arrow supports rolling functions at all, so this is also more of a discussion issue to figure out if that was on the roadmap

Component(s)

R

thisisnic commented 1 year ago

We don't currently support window functions. There are a few blockers before we're there, most of which are in #32991, though I don't think anyone is looking at those at the moment, so while I'd love to see them, I don't think it's something we're likely to have any time soon.

See https://github.com/apache/arrow/issues/34201#issuecomment-1454307957 for more details around this.