Skip to content

Commit 8945835

Browse files
committed
object SkewJoin extends Strategy
1 parent 2b98962 commit 8945835

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,15 @@ private[sql] abstract class SparkStrategies extends QueryPlanner[SparkPlan] {
193193
}
194194
}
195195
}
196+
197+
object SkewJoin extends Strategy with PredicateHelper {
198+
def apply(plan: LogicalPlan): Seq[SparkPlan] = plan match {
199+
// Find inner joins where at least some predicates can be evaluated by matching hash keys
200+
// using the HashFilteredJoin pattern.
201+
case SkewFilteredJoin(Inner, leftKeys, rightKeys, condition, left, right) =>
202+
val hashJoin =
203+
execution.SkewJoin(leftKeys, rightKeys, BuildRight, planLater(left), planLater(right), sparkContext)
204+
condition.map(Filter(_, hashJoin)).getOrElse(hashJoin) :: Nil
205+
case _ => Nil
206+
}
207+
}

0 commit comments

Comments
 (0)