-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
DuckDB recently released RANGE and GROUP window framing
right now just row based is supported as below. Since dbplyr, duckplyr, and ibis dont yet have this incorporated to my knowledge for a syntax reference, I think we have some freedom.
we could make an optional arg in _frame for it, which i think would be the most clear, but I'm open to ideas for when 1.2 gets released to julia
@chain DB.db_table(db, "test_df") begin
DB.@mutate(mean_7 = mean(percent),
_by = groups,
_order = value ,
_frame = (-3, 3))
DB.@arrange(groups, value)
@aside DB.@show_query _
end
WITH cte_1 AS (
SELECT id, groups, value, percent, AVG(percent) OVER (PARTITION BY groups
ORDER BY value ASC ROWS BETWEEN 3 PRECEDING AND 3 FOLLOWING) AS mean_7
FROM test_df)
SELECT *
FROM cte_1
ORDER BY groups ASC, value ASC
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels