gatorsmile commented on a change in pull request #24164: [SPARK-27225][SQL] 
Implement join strategy hints
URL: https://github.com/apache/spark/pull/24164#discussion_r269424547
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala
 ##########
 @@ -239,18 +312,47 @@ abstract class SparkStrategies extends 
QueryPlanner[SparkPlan] {
 
     def apply(plan: LogicalPlan): Seq[SparkPlan] = plan match {
 
-      // --- BroadcastHashJoin 
--------------------------------------------------------------------
+      // --- Hints specified, choose join strategy based on hints. 
--------------------------------
 
-      // broadcast hints were specified
+      // broadcast hints specified with equi-join keys, use broadcast-hash
       case ExtractEquiJoinKeys(joinType, leftKeys, rightKeys, condition, left, 
right, hint)
-        if canBroadcastByHints(joinType, left, right, hint) =>
+          if canBroadcastByHints(joinType, left, right, hint) =>
         val buildSide = broadcastSideByHints(joinType, left, right, hint)
         Seq(joins.BroadcastHashJoinExec(
           leftKeys, rightKeys, joinType, buildSide, condition, 
planLater(left), planLater(right)))
 
-      // broadcast hints were not specified, so need to infer it from size and 
configuration.
+      // broadcast hints specified with no equi-join keys, use 
broadcast-nested-loop
+      case j @ logical.Join(left, right, joinType, condition, hint)
 
 Review comment:
   remove 'j @' ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to