Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/19714#discussion_r153584009
--- 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)))
+ }
--- End diff --
Also add a test case?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]