Skip to content

[SPARK-56031][SQL] Make Natural Join column matching respect case sensitivity conf#54858

Open
stefankandic wants to merge 2 commits intoapache:masterfrom
stefankandic:stefankandic/naturalJoinFix
Open

[SPARK-56031][SQL] Make Natural Join column matching respect case sensitivity conf#54858
stefankandic wants to merge 2 commits intoapache:masterfrom
stefankandic:stefankandic/naturalJoinFix

Conversation

@stefankandic
Copy link
Contributor

What changes were proposed in this pull request?

Use conf.resolver instead of case-sensitive Seq.intersect when computing common column names for NATURAL JOIN in the fixed-point Analyzer.

Why are the changes needed?

NATURAL JOIN uses case-sensitive string comparison to find common columns, ignoring spark.sql.caseSensitive (which defaults to false). This causes NATURAL JOIN to silently degrade to a CROSS JOIN when columns differ only in case (e.g., ID vs id).

The equivalent USING join already handles this correctly.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

New unit and e2e tests in golden files.

Was this patch authored or co-authored using generative AI tooling?

No.

@stefankandic
Copy link
Contributor Author

@cloud-fan please take a look when you get a change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant