cuDF-Polars should support composable range-rolling aggregate expressions inside
grouped over(...), such as sum().rolling(...).over(...),
mean().rolling(...).over(...), min().rolling(...).over(...), and
max().rolling(...).over(...).
def test_expr_agg_rolling_over(engine: GPUEngine) -> None:
lf = pl.LazyFrame(
{
"g": ["A", "A", "B", "B"],
"ts": [1, 2, 1, 2],
"x": [10, 20, 30, 40],
}
).sort("g", "ts")
q = lf.select(
pl.col("x").sum().rolling("ts", period="2i").over("g"),
pl.col("x").min().rolling("ts", period="2i").over("g"),
)
assert_gpu_result_equal(q, engine=engine)
First-pass support can use the existing grouped-over strategy: forward shuffle
by group, local evaluation, and backward remapping to input rows. Huge-group /
low-cardinality execution can be handled as follow-up distributed window work.
cuDF-Polars should support composable range-rolling aggregate expressions inside
grouped
over(...), such assum().rolling(...).over(...),mean().rolling(...).over(...),min().rolling(...).over(...), andmax().rolling(...).over(...).First-pass support can use the existing grouped-over strategy: forward shuffle
by group, local evaluation, and backward remapping to input rows. Huge-group /
low-cardinality execution can be handled as follow-up distributed window work.