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