Skip to content

Commit 70508f0

Browse files
author
Davies Liu
committed
use canEvaluate
1 parent babe395 commit 70508f0

File tree

1 file changed

+2
-3
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer

1 file changed

+2
-3
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -733,9 +733,8 @@ object ReorderJoin extends Rule[LogicalPlan] with PredicateHelper {
733733
// find out the first join that have at least one join condition
734734
val conditionalJoin = rest.find { plan =>
735735
val refs = left.outputSet ++ plan.outputSet
736-
conditions.filterNot(_.references.subsetOf(left.outputSet))
737-
.filterNot(_.references.subsetOf(plan.outputSet))
738-
.exists(cond => cond.references.subsetOf(refs))
736+
conditions.filterNot(canEvaluate(_, left)).filterNot(canEvaluate(_, plan))
737+
.exists(_.references.subsetOf(refs))
739738
}
740739
// pick the next one if no condition left
741740
val right = conditionalJoin.getOrElse(rest.head)

0 commit comments

Comments
 (0)