dongjoon-hyun commented on code in PR #60458:
URL: https://github.com/apache/spark/pull/60458#discussion_r4568294668


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/InjectRuntimeFilter.scala:
##########
@@ -260,15 +260,18 @@ object InjectRuntimeFilter extends Rule[LogicalPlan] with 
PredicateHelper with J
       REGEXP_EXTRACT_FAMILY, REGEXP_REPLACE)
   }
 
-  private def isProbablyShuffleJoin(left: LogicalPlan,
-      right: LogicalPlan, hint: JoinHint): Boolean = {
-    !hintToBroadcastLeft(hint) && !hintToBroadcastRight(hint) &&
-      !canBroadcastBySize(left, conf) && !canBroadcastBySize(right, conf)
+  // A broadcast hash join can build only a side that its join type allows, 
and a hint can rule it
+  // out. A join without equi-join keys is not a hash join, so its join type 
does not matter here.
+  private def isProbablyShuffleJoin(join: Join): Boolean = join match {
+    case ExtractEquiJoinKeys(_, _, _, _, _, _, _, _) => 
!canPlanAsBroadcastHashJoin(join, conf)

Review Comment:
   Thank you, @peter-toth. I applied your suggestion and added a `merge(a)` 
case next to the `shuffle_hash(a)` one. The new case fails without the change.
   



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to