buraksenn opened a new pull request, #24183:
URL: https://github.com/apache/datafusion/pull/24183

   ## Which issue does this PR close?
   
   - Closes #24173
   
   ## Rationale for this change
   
   `GlobalLimitExec`/`LocalLimitExec` `required_ordering` is not serialized, so 
a roundtrip loses the only record that a pushed-down `LIMIT` is 
order-sensitive. Re-running `LimitPushdown` on the decoded plan then sets 
`preserve_order: false` on the scan, which is free to read files out of order — 
`ORDER BY ... LIMIT` can return the wrong rows.
   
   ## What changes are included in this PR?
   
   - Add `required_ordering` to `GlobalLimitExecNode` (field 4) and 
`LocalLimitExecNode` (field 3); empty list means `None`
   - New `optional_ordering_try_to_proto`/`optional_ordering_try_from_proto` 
helpers in `physical-expr-common`, also reused by `SymmetricHashJoinExec` serde 
which hand-rolled the same pattern
   - Preserve `required_ordering` in both execs' `with_new_children`
   ## Are these changes tested?
   Yes new tests that would fail on main if not fixed
   
   ## Are there any user-facing changes?
   No
   


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