Kristofferjoha opened a new pull request, #26719:
URL: https://github.com/apache/datafusion/pull/26719
## Which issue does this PR close?
Closes #26617.
## Rationale for this change
With multiple execution partitions, replacing an outer TopK sort with an
ordered merge can push its limit below a window that needs all input rows.
The reproducer returns `count(*) OVER () = 1` instead of 3.
## What changes are included in this PR?
- Only propagate fetch through operators that support limit pushdown.
- Retain the original limit above the replacement plan when removing the
sort.
- Add SQL regressions for `LIMIT 1` and `LIMIT 1 OFFSET 1` with four target
partitions.
## What is the testing strategy for this PR?
The new cases in `window_limits.slt` expect `(3, 1)` and `(3, 2)`.
Before the fix, they return `(1, 1)` and `(2, 2)`.
## Are there any user-facing changes?
None other than user gets correct window results when an outer TopK sort is
replaced with an
ordered merge.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]