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
Commit 4877863
Browse filesBrowse the repository at this point in the historyBrowse files
fix: don't invent a limit from LimitEffect::Absolute
Review feedback. `LimitEffect::Absolute(n)` means the window needs at
least `n` input rows whatever the limit is, so `grow_limit` raises the
limit it is carrying to `n`. It did that through `ctx.limit.unwrap_or(0)`,
which with no limit in hand does not raise a limit but invents one: the
sort below then gets `TopK(fetch=n)` although nothing above it asked for
a limit at all, and rows the query wanted are dropped. Unlike the rest of
this PR that is a wrong-results bug, and it is pre-existing; this PR adds
another path that reaches it, since the walk now continues below a sort it
has already given a fetch to.
With nothing in hand there is nothing to raise, so leave the limit alone.
No in-tree window function returns `Absolute` -- `ntile`, `cume_dist` and
`percent_rank` return `Unknown`, `row_number`, `nth_value`, `rank` and
`dense_rank` return `None`, and `lead`/`lag` return `Relative(n)` or
`Unknown` -- so the arm is unreachable from SQL and this is a unit test
rather than a `.slt` case, per the testing guide. The two tests divide up
as follows: the first is red without the fix, and the second is green
either way and holds down the `max`, so that deleting the arm is not
mistaken for a fix.
Co-Authored-By: Claude Opus 5 <[email protected]>
0 commit comments