cloud-fan commented on code in PR #38464:
URL: https://github.com/apache/spark/pull/38464#discussion_r1023684019


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/PlanAdaptiveDynamicPruningFilters.scala:
##########
@@ -77,6 +82,24 @@ case class PlanAdaptiveDynamicPruningFilters(
           val newAdaptivePlan = sparkPlan.asInstanceOf[AdaptiveSparkPlanExec]
           val values = SubqueryExec(name, newAdaptivePlan)
           DynamicPruningExpression(InSubqueryExec(value, values, exprId))
+        } else if (!conf.exchangeReuseEnabled) {
+          DynamicPruningExpression(Literal.TrueLiteral)
+        } else {
+          val childPlan = adaptivePlan.executedPlan
+          val reusedShuffleExchange = collectFirst(rootPlan) {
+            case s: ShuffleExchangeExec if s.child.sameResult(childPlan) => s

Review Comment:
   This is another tricky part: is reusing shuffle always better than starting 
a new query with column pruning?



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