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
> SELECT avg(y) - stddev(y)/sqrt(count(y)) AS "y1", avg(y) + stddev(y)/sqrt(count(y)) AS "y2", ntile(10) over (order by x_val) AS "x" FROM "df" AS "source" GROUP BY "x"
Binder Error: GROUP BY clause cannot contain window functions!
It'd be pretty nice if the above chart snippet could work because the intent seems unambiguous to me.
A suggestion for making it work would be to modify the query generation to move the non-aggregate clause computation into a "WITH" statement where there are no restrictions on window functions, i.e.
WITH "__mosaicTemp" AS (SELECT *, ntile(10) over (order by x_val) AS "x" FROM "df") SELECT avg(y) - stddev(y)/sqrt(count(y)) AS "y1", avg(y) + stddev(y)/sqrt(count(y)) AS "y2", "x" FROM "__mosaicTemp" GROUP BY "x"
which I think should not be a perf cost in cases where it's not needed because duckdb will optimize it away (?).
The text was updated successfully, but these errors were encountered:
This is half bug half feature request. The following snippet does not currently work,
That's because the generated sql is problematic,
It'd be pretty nice if the above chart snippet could work because the intent seems unambiguous to me.
A suggestion for making it work would be to modify the query generation to move the non-aggregate clause computation into a "WITH" statement where there are no restrictions on window functions, i.e.
which I think should not be a perf cost in cases where it's not needed because duckdb will optimize it away (?).
The text was updated successfully, but these errors were encountered: