[SPARK-56031][SQL] Make Natural Join column matching respect case sensitivity conf#54858
Closed
stefankandic wants to merge 2 commits intoapache:masterfrom
Closed
[SPARK-56031][SQL] Make Natural Join column matching respect case sensitivity conf#54858stefankandic wants to merge 2 commits intoapache:masterfrom
stefankandic wants to merge 2 commits intoapache:masterfrom
Conversation
Contributor
Author
|
@cloud-fan please take a look when you get a change |
Contributor
|
thanks, merging to master! |
terana
pushed a commit
to terana/spark
that referenced
this pull request
Mar 23, 2026
…sitivity conf ### 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. Closes apache#54858 from stefankandic/stefankandic/naturalJoinFix. Authored-by: Stefan Kandic <stefan.kandic@databricks.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Use
conf.resolverinstead of case-sensitiveSeq.intersectwhen computing common column names forNATURAL JOINin the fixed-point Analyzer.Why are the changes needed?
NATURAL JOINuses case-sensitive string comparison to find common columns, ignoringspark.sql.caseSensitive(which defaults tofalse). This causesNATURAL JOINto silently degrade to aCROSS JOINwhen columns differ only in case (e.g.,IDvsid).The equivalent
USINGjoin 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.