jayzhan211 commented on issue #26697:
URL: https://github.com/apache/datafusion/issues/26697#issuecomment-7132616994

   @nikhilred2619 thanks. No item has an owner yet. A good one to start with is 
"Keeps rows by position" from the list above.
   
   Since #26660, a node can declare that it keeps rows by position: 
`limit_behavior()` returns `LimitBehavior::Limit { skip, fetch }`. Sort 
pushdown (`enforce_sorting/sort_pushdown.rs`) still recognizes only the 
built-in limits, in two places:
   
   - `input_fetch` takes `skip` only from `GlobalLimitExec`. Before #26660, 
`Sort(a)` over a custom `Offset(skip=2, fetch=5)` returned 3 rows instead of 5. 
I haven't re-run it since.
   - `pushdown_requirement_to_children` stops a sort from moving below 
`GlobalLimitExec` and `LocalLimitExec` only. Sorting below a limit changes 
which rows it keeps.
   
   Could you start with a test on main where a custom node that declares 
`LimitBehavior::Limit` gives a different result from `GlobalLimitExec` in the 
same plan? Please open it as an issue linked here, with the test and its 
output. The fix then replaces those type checks with a check on 
`limit_behavior()`, like the `selects_rows` example in the description.
   


-- 
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]

Reply via email to