-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-16301] [SQL] The analyzer rule for resolving using joins should respect the case sensitivity setting. #13977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1836,13 +1836,15 @@ class Analyzer( | |
| } | ||
|
|
||
| private def commonNaturalJoinProcessing( | ||
| left: LogicalPlan, | ||
| right: LogicalPlan, | ||
| joinType: JoinType, | ||
| joinNames: Seq[String], | ||
| condition: Option[Expression]) = { | ||
| val leftKeys = joinNames.map(keyName => left.output.find(_.name == keyName).get) | ||
| val rightKeys = joinNames.map(keyName => right.output.find(_.name == keyName).get) | ||
| left: LogicalPlan, | ||
| right: LogicalPlan, | ||
| joinType: JoinType, | ||
| joinNames: Seq[String], | ||
| condition: Option[Expression]) = { | ||
| val leftKeys = | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to throw a better exception here as well in case
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala#L1825 will make sure that it will not be None after this issue is fixed. I can add an assert. |
||
| joinNames.map(keyName => left.output.find(attr => resolver(attr.name, keyName)).get) | ||
| val rightKeys = | ||
| joinNames.map(keyName => right.output.find(attr => resolver(attr.name, keyName)).get) | ||
| val joinPairs = leftKeys.zip(rightKeys) | ||
|
|
||
| val newCondition = (condition ++ joinPairs.map(EqualTo.tupled)).reduceOption(And) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 5 lines are just formatting changes.