Skip to content

fix: Improve error message for metadata conflict in schema - #23952

Draft
mkleen wants to merge 2 commits into
apache:mainfrom
mkleen:improve-err-schema-mismatch
Draft

fix: Improve error message for metadata conflict in schema#23952
mkleen wants to merge 2 commits into
apache:mainfrom
mkleen:improve-err-schema-mismatch

Conversation

@mkleen

@mkleen mkleen commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Based on the discussion in #23461 this pr improves the error message when there is a metadata conflict when schemas get merged. It also reverts #23605, so CrossJoinExec has again it's original behavior.

select * from larger_table cross join smaller_table;

DataFusion error: PhysicalOptimizer rule 'join_selection' failed. Schema mismatch caused by 
Internal error: Schema metadata mismatch: Expected original metadata: {"metadata_key": "right"}, got metadata: {"metadata_key": "left"}

What changes are included in this PR?

Are these changes tested?

Yes

Are there any user-facing changes?

Yes, error message improved when the schema metadata has conflicting keys using a cross-join.

@github-actions github-actions Bot added core Core DataFusion crate sqllogictest SQL Logic Tests (.slt) physical-plan Changes to the physical-plan crate labels Jul 28, 2026
@mkleen mkleen changed the title Improve error message for metadata conflict in schema fix: Improve error message for metadata conflict in schema Jul 28, 2026
@mkleen
mkleen force-pushed the improve-err-schema-mismatch branch 3 times, most recently from b541f02 to 0cf026b Compare July 29, 2026 10:20
@mkleen
mkleen force-pushed the improve-err-schema-mismatch branch from 0cf026b to 745aed7 Compare July 29, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate physical-plan Changes to the physical-plan crate sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Join swap in join_selection flips schema-level metadata, failing "Schema mismatch"

1 participant