oss-maker commented on code in PR #41860:
URL: https://github.com/apache/spark/pull/41860#discussion_r1253952363


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/InjectRuntimeFilter.scala:
##########
@@ -185,14 +186,18 @@ object InjectRuntimeFilter extends Rule[LogicalPlan] with 
PredicateHelper with J
   }
 
   private def isProbablyShuffleJoin(left: LogicalPlan,
-      right: LogicalPlan, hint: JoinHint): Boolean = {
-    !hintToBroadcastLeft(hint) && !hintToBroadcastRight(hint) &&
-      !canBroadcastBySize(left, conf) && !canBroadcastBySize(right, conf)
+                                    right: LogicalPlan,
+                                    hint: JoinHint,
+                                    joinType: JoinType): Boolean = {
+    // If any of the side can be broadcast, then it is not a shuffle join.
+    !canLeftSideBeBroadcast(left, conf, hint, joinType) &&

Review Comment:
   I think you can simplify this since there are only two checks to
   !(canLeftSideBeBroadcast(left, conf, hint, joinType) || 
canRightSideBeBroadcast(right, conf, hint, joinType))



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to