Skip to content

Split and deprecate and_or - #24276

Open
Nagato-Yuzuru wants to merge 7 commits into
apache:mainfrom
Nagato-Yuzuru:issue-24208
Open

Split and deprecate and_or#24276
Nagato-Yuzuru wants to merge 7 commits into
apache:mainfrom
Nagato-Yuzuru:issue-24208

Conversation

@Nagato-Yuzuru

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Stacked on #24206: I will rebase once merges after it merged.

Rationale for this change

Under Kleene logic, the behavior of and and or is inconsistent with respect to transitivity of ordered.

See #24208 for the counterexamples and the full rules.

What changes are included in this PR?

  • Split SortProperties::and_or into and / or . BinaryExpr::get_properties now calls the matching method per operator.
  • Deprecate and_or and narrow it to what and and or agree on (Singleton/SingletonSingleton, everything else Unordered). A caller of and_or does not say which operator it means, so any stronger claim is wrong for one of them. The previous behavior is this bug.

Are these changes tested?

Yes

Are there any user-facing changes?

Yes. Split and deprecate and_or

@github-actions github-actions Bot added logical-expr Logical plan and expressions physical-expr Changes to the physical-expr crates sqllogictest SQL Logic Tests (.slt) labels Aug 11, 2026
@Nagato-Yuzuru

Copy link
Copy Markdown
Contributor Author

I'm not sure if the patch will into version 55.0. It looks like it's about to be released. I'd be happy to update the deprecation description and add breaking change documentation.

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

Thank you for opening this pull request!

Reviewer note: 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
     Cloning apache/main
    Building datafusion-expr-common v54.1.0 (current)
       Built [  20.680s] (current)
     Parsing datafusion-expr-common v54.1.0 (current)
      Parsed [   0.018s] (current)
    Building datafusion-expr-common v54.1.0 (baseline)
       Built [  19.756s] (baseline)
     Parsing datafusion-expr-common v54.1.0 (baseline)
      Parsed [   0.018s] (baseline)
    Checking datafusion-expr-common v54.1.0 -> v54.1.0 (no change; assume patch)
     Checked [   0.217s] 223 checks: 222 pass, 1 fail, 0 warn, 31 skip

--- failure type_method_marked_deprecated: type method #[deprecated] added ---

Description:
A type method is now #[deprecated]. Downstream crates will get a compiler warning when using this method.
        ref: https://doc.rust-lang.org/reference/attributes/diagnostics.html#the-deprecated-attribute
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/type_method_marked_deprecated.ron

Failed in:
  method datafusion_expr_common::sort_properties::SortProperties::and_or in /home/runner/work/datafusion/datafusion/datafusion/expr-common/src/sort_properties.rs:116

     Summary semver requires new minor version: 0 major and 1 minor checks failed
    Finished [  41.991s] datafusion-expr-common
    Building datafusion-physical-expr v54.1.0 (current)
       Built [  29.288s] (current)
     Parsing datafusion-physical-expr v54.1.0 (current)
      Parsed [   0.049s] (current)
    Building datafusion-physical-expr v54.1.0 (baseline)
       Built [  29.104s] (baseline)
     Parsing datafusion-physical-expr v54.1.0 (baseline)
      Parsed [   0.050s] (baseline)
    Checking datafusion-physical-expr v54.1.0 -> v54.1.0 (no change; assume patch)
     Checked [   0.351s] 223 checks: 223 pass, 31 skip
     Summary no semver update required
    Finished [  60.464s] datafusion-physical-expr
    Building datafusion-sqllogictest v54.1.0 (current)
       Built [ 182.066s] (current)
     Parsing datafusion-sqllogictest v54.1.0 (current)
      Parsed [   0.022s] (current)
    Building datafusion-sqllogictest v54.1.0 (baseline)
       Built [ 181.988s] (baseline)
     Parsing datafusion-sqllogictest v54.1.0 (baseline)
      Parsed [   0.022s] (baseline)
    Checking datafusion-sqllogictest v54.1.0 -> v54.1.0 (no change; assume patch)
     Checked [   0.091s] 223 checks: 223 pass, 31 skip
     Summary no semver update required
    Finished [ 367.427s] datafusion-sqllogictest

@github-actions github-actions Bot added the auto detected api change Auto detected API change label Aug 11, 2026
@codecov-commenter

codecov-commenter commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.30%. Comparing base (eec8b94) to head (2ad0363).
⚠️ Report is 59 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #24276      +/-   ##
==========================================
+ Coverage   81.05%   81.30%   +0.25%     
==========================================
  Files        1106     1110       +4     
  Lines      382287   385497    +3210     
  Branches   382287   385497    +3210     
==========================================
+ Hits       309851   313438    +3587     
+ Misses      54121    53582     -539     
- Partials    18315    18477     +162     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto detected api change Auto detected API change documentation Improvements or additions to documentation logical-expr Logical plan and expressions physical-expr Changes to the physical-expr crates sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SortProperties::and_or claims orderings that Kleene AND/OR do not preserve

2 participants