You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/09/14 12:17:49 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #29726: [SPARK-32855][SQL] Improve DPP for some join type do not support broadcast filtering side

cloud-fan commented on a change in pull request #29726:
URL: https://github.com/apache/spark/pull/29726#discussion_r487866106



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/dynamicpruning/PartitionPruning.scala
##########
@@ -196,6 +198,25 @@ object PartitionPruning extends Rule[LogicalPlan] with PredicateHelper {
     case _ => false
   }
 
+  /**
+   * For some filtering side can not broadcast by join type but can broadcast by size,
+   * then we should not consider reuse broadcast only, for example:
+   * Left outer join and left side very small.
+   */
+  private def isReuseBroadcastOnly(
+      canBuildBroadcast: Boolean,
+      hasBenefit: Boolean,
+      hintToBroadcastPruningSide: Boolean,
+      pruningPlan: LogicalPlan,
+      filteringPlan: LogicalPlan): Boolean = {
+    if (canBuildBroadcast) {
+      !hasBenefit || SQLConf.get.dynamicPartitionPruningReuseBroadcastOnly
+    } else {
+      !(hasBenefit && canBroadcastBySize(filteringPlan, SQLConf.get) &&
+        !hintToBroadcastPruningSide && !canBroadcastBySize(pruningPlan, SQLConf.get))

Review comment:
       `!canBroadcastBySize(pruningPlan, SQLConf.get)` do we need this condition?




----------------------------------------------------------------
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:
users@infra.apache.org



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