Skip to content

Commit a925d08

Browse files
committed
check for conflicting attributes in join resolution
1 parent b022ef7 commit a925d08

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicOperators.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ case class Join(
103103
left.output ++ right.output
104104
}
105105
}
106+
107+
def selfJoinResolved = left.outputSet.intersect(right.outputSet).isEmpty
108+
109+
// Joins are only resolved if they don't introduce ambiguious expression ids.
110+
override lazy val resolved: Boolean = {
111+
childrenResolved && !expressions.exists(!_.resolved) && selfJoinResolved
112+
}
106113
}
107114

108115
case class Except(left: LogicalPlan, right: LogicalPlan) extends BinaryNode {

0 commit comments

Comments
 (0)