Skip to content

Cherry-pick apache/datafusion#27573 - #223

Merged
alexanderbianchi merged 1 commit into
branch-55from
alex.bianchi/cherry-pick/apache-pr-27573-20261124
Nov 24, 2026
Merged

alexanderbianchi merged 1 commit into
branch-55from
alex.bianchi/cherry-pick/apache-pr-27573-20261124

Conversation

@alexanderbianchi

Copy link
Copy Markdown

Which issue does this PR close?

Backport of apache#27573 to branch-55.

Rationale for this change

A LIMIT over a join can leave a UNION input with names that differ from its output schema, causing a planning failure after a Substrait round trip.

What changes are included in this PR?

For a non-projection input whose field names differ, project its columns onto the UNION output names by position. Leave matching inputs alone.

Are these changes tested?

Adds the LIMIT-over-join case to limit.slt. That case passed as SQL and through a Substrait round trip on the combined release pin; not rerun on this standalone head. Workspace formatting passed.

Are there any user-facing changes?

Affected UNION ALL queries can plan without changing their output names.

(cherry picked from commit a11db8d)
(cherry picked from commit 023355c)
(cherry picked from commit c2bb15a)
@codecov-commenter

codecov-commenter commented Nov 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.45455% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.22%. Comparing base (5bc24de) to head (a295118).

Files with missing lines Patch % Lines
datafusion/optimizer/src/analyzer/type_coercion.rs 95.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           branch-55     #223   +/-   ##
==========================================
  Coverage      81.22%   81.22%           
==========================================
  Files           1112     1112           
  Lines         390872   390892   +20     
  Branches      390872   390892   +20     
==========================================
+ Hits          317478   317498   +20     
- Misses         54441    54442    +1     
+ Partials       18953    18952    -1     

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

@alexanderbianchi
alexanderbianchi merged commit 9e1437b into branch-55 Nov 24, 2026
70 checks passed
@alexanderbianchi
alexanderbianchi deleted the alex.bianchi/cherry-pick/apache-pr-27573-20261124 branch November 24, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants