maryannxue commented on a change in pull request #29726:
URL: https://github.com/apache/spark/pull/29726#discussion_r589591161



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/dynamicpruning/PartitionPruning.scala
##########
@@ -85,22 +86,36 @@ object PartitionPruning extends Rule[LogicalPlan] with 
PredicateHelper {
       filteringKey: Expression,
       filteringPlan: LogicalPlan,
       joinKeys: Seq[Expression],
-      partScan: LogicalRelation): LogicalPlan = {
-    val reuseEnabled = SQLConf.get.exchangeReuseEnabled
+      partScan: LogicalRelation,
+      canBuildBroadcast: Boolean): LogicalPlan = {
     val index = joinKeys.indexOf(filteringKey)
-    lazy val hasBenefit = pruningHasBenefit(pruningKey, partScan, 
filteringKey, filteringPlan)
-    if (reuseEnabled || hasBenefit) {
-      // insert a DynamicPruning wrapper to identify the subquery during query 
planning
+    lazy val hasBenefit = pruningHasBenefit(

Review comment:
       I don't quite get it here. `pruningHasBenefit` was meant to return 
"whether it's worth pruning even if there's no broadcast reuse, in other words, 
even if we have to run an extra subquery on its own", so why do we need to pass 
over `canBuildBroadcast` to this method?




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



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

Reply via email to