cloud-fan commented on a change in pull request #26813: [SPARK-30188][SQL][WIP] 
Enable adaptive query execution by default
URL: https://github.com/apache/spark/pull/26813#discussion_r361906015
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/InsertAdaptiveSparkPlan.scala
 ##########
 @@ -45,11 +48,33 @@ case class InsertAdaptiveSparkPlan(session: SparkSession) 
extends Rule[SparkPlan
   // Exchange-reuse is shared across the entire query, including sub-queries.
   private val stageCache = new TrieMap[SparkPlan, QueryStageExec]()
 
+  private def needShuffle(plan: SparkPlan): Boolean = plan match {
+    case _: BroadcastHashJoinExec => true
+    case _: BroadcastNestedLoopJoinExec => true
+    case _: CoGroupExec => true
+    case _: GlobalLimitExec => true
+    case _: HashAggregateExec => true
+    case _: ObjectHashAggregateExec => true
+    case _: ShuffledHashJoinExec => true
+    case _: SortAggregateExec => true
+    case _: SortExec => true
+    case _: SortMergeJoinExec => true
+    case _: ShuffleExchangeExec => true
 
 Review comment:
   to be safe, let's catch `Exchange`

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


With regards,
Apache Git Services

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

Reply via email to