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_r362016370
 
 

 ##########
 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 _: Exchange => true
+    case _ => false
+  }
+
+  def whetherContainShuffle(plan: SparkPlan): Boolean = {
+    plan.collect {
 
 Review comment:
   nit: `find` is better here

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


With regards,
Apache Git Services

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

Reply via email to