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



##########
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:
       This is used to set `onlyInBroadcast` to false. Because 
`SQLConf.get.dynamicPartitionPruningReuseBroadcastOnly ||! hasBenefit` is 
always true by default.




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