You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "buraksenn (via GitHub)" <gi...@apache.org> on 2026/08/08 13:19:58 UTC

[PR] fix(proto): serialize Global/LocalLimitExec required_ordering [datafusion]

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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] fix(proto): serialize Global/LocalLimitExec required_ordering [datafusion]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #24183:
URL: https://github.com/apache/datafusion/pull/24183#issuecomment-5226379622

   ## [Codecov](https://app.codecov.io/gh/apache/datafusion/pull/24183?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `64.03509%` with `41 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 81.05%. Comparing base ([`66c3840`](https://app.codecov.io/gh/apache/datafusion/commit/66c3840c029e839eb8d49d5dd721a4d1735152aa?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`a960449`](https://app.codecov.io/gh/apache/datafusion/commit/a9604496590f2df5c3a4882ef2d0569499fb6973?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 67 commits behind head on main.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/datafusion/pull/24183?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [datafusion/proto-models/src/generated/pbjson.rs](https://app.codecov.io/gh/apache/datafusion/pull/24183?src=pr&el=tree&filepath=datafusion%2Fproto-models%2Fsrc%2Fgenerated%2Fpbjson.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZGF0YWZ1c2lvbi9wcm90by1tb2RlbHMvc3JjL2dlbmVyYXRlZC9wYmpzb24ucnM=) | 0.00% | [29 Missing :warning: ](https://app.codecov.io/gh/apache/datafusion/pull/24183?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [datafusion/physical-plan/src/limit.rs](https://app.codecov.io/gh/apache/datafusion/pull/24183?src=pr&el=tree&filepath=datafusion%2Fphysical-plan%2Fsrc%2Flimit.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZGF0YWZ1c2lvbi9waHlzaWNhbC1wbGFuL3NyYy9saW1pdC5ycw==) | 87.27% | [4 Missing and 3 partials :warning: ](https://app.codecov.io/gh/apache/datafusion/pull/24183?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...ion/physical-plan/src/joins/symmetric\_hash\_join.rs](https://app.codecov.io/gh/apache/datafusion/pull/24183?src=pr&el=tree&filepath=datafusion%2Fphysical-plan%2Fsrc%2Fjoins%2Fsymmetric_hash_join.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZGF0YWZ1c2lvbi9waHlzaWNhbC1wbGFuL3NyYy9qb2lucy9zeW1tZXRyaWNfaGFzaF9qb2luLnJz) | 77.77% | [4 Missing :warning: ](https://app.codecov.io/gh/apache/datafusion/pull/24183?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [datafusion/physical-expr-common/src/sort\_expr.rs](https://app.codecov.io/gh/apache/datafusion/pull/24183?src=pr&el=tree&filepath=datafusion%2Fphysical-expr-common%2Fsrc%2Fsort_expr.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZGF0YWZ1c2lvbi9waHlzaWNhbC1leHByLWNvbW1vbi9zcmMvc29ydF9leHByLnJz) | 91.66% | [0 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/datafusion/pull/24183?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff             @@
   ##             main   #24183      +/-   ##
   ==========================================
   + Coverage   80.86%   81.05%   +0.19%     
   ==========================================
     Files        1101     1106       +5     
     Lines      375446   382322    +6876     
     Branches   375446   382322    +6876     
   ==========================================
   + Hits       303592   309896    +6304     
   - Misses      53761    54118     +357     
   - Partials    18093    18308     +215     
   ```
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/datafusion/pull/24183?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] fix(proto): serialize Global/LocalLimitExec required_ordering [datafusion]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #24183:
URL: https://github.com/apache/datafusion/pull/24183#issuecomment-5226305025

   <!-- semver-check-comment -->
   Thank you for opening this pull request!
   
   Reviewer note: [cargo-semver-checks](https://github.com/obi1kenobi/cargo-semver-checks) reported the current version number is not SemVer-compatible with the changes in this pull request (compared against the base branch).
   
   <details>
   <summary>Details</summary>
   
   ```
        Cloning apache/main
       Building datafusion-physical-expr-common v54.1.0 (current)
          Built [  35.821s] (current)
        Parsing datafusion-physical-expr-common v54.1.0 (current)
         Parsed [   0.021s] (current)
       Building datafusion-physical-expr-common v54.1.0 (baseline)
          Built [  25.622s] (baseline)
        Parsing datafusion-physical-expr-common v54.1.0 (baseline)
         Parsed [   0.023s] (baseline)
       Checking datafusion-physical-expr-common v54.1.0 -> v54.1.0 (no change; assume patch)
        Checked [   0.200s] 223 checks: 223 pass, 30 skip
        Summary no semver update required
       Finished [  62.781s] datafusion-physical-expr-common
       Building datafusion-physical-plan v54.1.0 (current)
          Built [  40.119s] (current)
        Parsing datafusion-physical-plan v54.1.0 (current)
         Parsed [   0.148s] (current)
       Building datafusion-physical-plan v54.1.0 (baseline)
          Built [  40.176s] (baseline)
        Parsing datafusion-physical-plan v54.1.0 (baseline)
         Parsed [   0.146s] (baseline)
       Checking datafusion-physical-plan v54.1.0 -> v54.1.0 (no change; assume patch)
        Checked [   0.618s] 223 checks: 223 pass, 30 skip
        Summary no semver update required
       Finished [  82.387s] datafusion-physical-plan
       Building datafusion-proto v54.1.0 (current)
          Built [  65.072s] (current)
        Parsing datafusion-proto v54.1.0 (current)
         Parsed [   0.018s] (current)
       Building datafusion-proto v54.1.0 (baseline)
          Built [  65.993s] (baseline)
        Parsing datafusion-proto v54.1.0 (baseline)
         Parsed [   0.019s] (baseline)
       Checking datafusion-proto v54.1.0 -> v54.1.0 (no change; assume patch)
        Checked [   0.253s] 223 checks: 223 pass, 30 skip
        Summary no semver update required
       Finished [ 132.655s] datafusion-proto
       Building datafusion-proto-models v54.1.0 (current)
          Built [  26.646s] (current)
        Parsing datafusion-proto-models v54.1.0 (current)
         Parsed [   0.133s] (current)
       Building datafusion-proto-models v54.1.0 (baseline)
          Built [  26.773s] (baseline)
        Parsing datafusion-proto-models v54.1.0 (baseline)
         Parsed [   0.134s] (baseline)
       Checking datafusion-proto-models v54.1.0 -> v54.1.0 (no change; assume patch)
        Checked [   1.735s] 223 checks: 222 pass, 1 fail, 0 warn, 30 skip
   
   --- failure constructible_struct_adds_field: externally-constructible struct adds field ---
   
   Description:
   A pub struct constructible with a struct literal has a new pub field. Existing struct literals must be updated to include the new field.
           ref: https://doc.rust-lang.org/reference/expressions/struct-expr.html
          impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.49.0/src/lints/constructible_struct_adds_field.ron
   
   Failed in:
     field GlobalLimitExecNode.required_ordering in /home/runner/work/datafusion/datafusion/datafusion/proto-models/src/generated/prost.rs:2246
     field GlobalLimitExecNode.required_ordering in /home/runner/work/datafusion/datafusion/datafusion/proto-models/src/generated/prost.rs:2246
     field LocalLimitExecNode.required_ordering in /home/runner/work/datafusion/datafusion/datafusion/proto-models/src/generated/prost.rs:2256
     field LocalLimitExecNode.required_ordering in /home/runner/work/datafusion/datafusion/datafusion/proto-models/src/generated/prost.rs:2256
   
        Summary semver requires new major version: 1 major and 0 minor checks failed
       Finished [  56.527s] datafusion-proto-models
   ```
   
   </details>


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] fix(proto): serialize Global/LocalLimitExec required_ordering [datafusion]

Posted by "adriangb (via GitHub)" <gi...@apache.org>.
adriangb merged PR #24183:
URL: https://github.com/apache/datafusion/pull/24183


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org