You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way in dbplyr to generate SQL of the form
SELECT
SUM(`col1`) OVER `wnd` AS `s1`,
SUM(`col2`) OVER `wnd` AS `s2`,
SUM(`col3`) OVER `wnd` AS `s3`
FROM `my_table`
WINDOW `wnd` AS (PARTITION BY `col4` ORDER BY `col5`)
?
(i.e., avoid spelling out the same window-spec repeatedly within the same query, and refer to it by a name instead) ?
The benefit of having this is the generated query would be shorter and easier to debug (as it's immediately clear that the same window spec is applied to multiple aggregations).
The text was updated successfully, but these errors were encountered:
Not currently, and I suspect it wouldn't be worth the effort to implement it because it involving somehow hoisting data about individual expressions up to the query level. Not impossible, but I'd need to spend a decent amount of time thinking about it, and investigating support for WINDOW across databases.
Is there a way in
dbplyr
to generate SQL of the form?
(i.e., avoid spelling out the same window-spec repeatedly within the same query, and refer to it by a name instead) ?
The benefit of having this is the generated query would be shorter and easier to debug (as it's immediately clear that the same window spec is applied to multiple aggregations).
The text was updated successfully, but these errors were encountered: