Github user gatorsmile commented on a diff in the pull request: https://github.com/apache/spark/pull/19714#discussion_r153583413 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala --- @@ -153,6 +151,27 @@ abstract class SparkStrategies extends QueryPlanner[SparkPlan] { // --- BroadcastHashJoin -------------------------------------------------------------------- + case ExtractEquiJoinKeys(joinType, leftKeys, rightKeys, condition, left, right) + if canBuildRight(joinType) && canBuildLeft(joinType) + && left.stats.hints.broadcast && right.stats.hints.broadcast => + if (right.stats.sizeInBytes <= left.stats.sizeInBytes) { + Seq(joins.BroadcastHashJoinExec( + leftKeys, rightKeys, joinType, BuildRight, condition, planLater(left), planLater(right))) + } else { + Seq(joins.BroadcastHashJoinExec( + leftKeys, rightKeys, joinType, BuildLeft, condition, planLater(left), planLater(right))) + } + + case ExtractEquiJoinKeys(joinType, leftKeys, rightKeys, condition, left, right) + if canBuildRight(joinType) && right.stats.hints.broadcast => --- End diff -- two more space before if
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org