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
{{ message }}
Repository navigation
Review #2411 for code improvements: window aggregates are a second implementation on the output rows #2690
This is not a bug report. It is an invitation to look at #2411 again, because it computes window aggregates in a separate pass over the output rows. The goal is to understand the change and decide whether anything should be improved. The notes below come from a quick read of the diff and a few runs, not from a full analysis.
The concerns:
A second implementation of the aggregates, on the output.Fix window aggregate functions not implementing semantics #2411 adds a pass in yy.Select.compile (src/40select.js) with its own switch for COUNT, SUM, AVG, MIN and MAX, reading res[i][columnid] by name. The result is wrong when the column is not selected or the argument is an expression; the bug is Window aggregates read the output row: SUM(v) OVER (PARTITION BY g) gives 0 when v is not selected #2689. Only the five in the switch are known: a user-defined aggregate (alasql.aggr) with OVER leaves its column out of the result, and SUM(DISTINCT v) OVER (…) adds duplicates. MIN / MAX use Math.min / Math.max, so MAX(name) OVER (…) gives NaN.
Activity
mathiasrw commentedon Nov 26, 2026
Will be covered by #2702.