Skip to content

Fix panic on RightMark hash joins when propagating ordering - #24718

Merged
alamb merged 1 commit into
apache:mainfrom
Tpt:tpt/issue-24717
Aug 27, 2026
Merged

Fix panic on RightMark hash joins when propagating ordering#24718
alamb merged 1 commit into
apache:mainfrom
Tpt:tpt/issue-24717

Conversation

@Tpt

@Tpt Tpt commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Fixes a panic in enforce_sorting when given a RightMark hash join: HashjoinExec::maintains_input_order has been changed to also return true on RightMark but enforce_sorting has not been updated

What changes are included in this PR?

Adds support of RightMark joins to enforce_sorting they keep the input sorting.

`maintains_input_order` has been changed to also return `true` on `RightMark` but this function has not been updated

Close apache#24717
@github-actions github-actions Bot added optimizer Optimizer rules core Core DataFusion crate labels Aug 27, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.45%. Comparing base (a38bb10) to head (3b969f4).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #24718      +/-   ##
==========================================
- Coverage   81.45%   81.45%   -0.01%     
==========================================
  Files        1120     1120              
  Lines      401289   401289              
  Branches   401289   401289              
==========================================
- Hits       326871   326866       -5     
- Misses      55295    55300       +5     
  Partials    19123    19123              

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

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Tpt

JoinType::RightSemi | JoinType::RightAnti | JoinType::RightMark => {
map_fields(plan.right().schema(), JoinSide::Right)
}
_ => unreachable!("unexpected join type: {}", plan.join_type()),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make this more defensive, it would be great to make this unreachable into an internal error

@alamb
alamb added this pull request to the merge queue Aug 27, 2026
Merged via the queue into apache:main with commit 1038d35 Aug 27, 2026
41 checks passed
@Tpt
Tpt deleted the tpt/issue-24717 branch September 1, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate optimizer Optimizer rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DF 55: physical-optimizer enforce_sorting panics on RightMark joins

3 participants