cloud-fan commented on a change in pull request #26813: [SPARK-30188][SQL][WIP] 
Resolve the failed unit tests when enable AQE
URL: https://github.com/apache/spark/pull/26813#discussion_r364247731
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/InsertAdaptiveSparkPlan.scala
 ##########
 @@ -45,11 +49,45 @@ 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 a: AdaptiveSparkPlanExec => needShuffle(a.executedPlan)
 
 Review comment:
   how can we hit this before inserting `AdaptiveSparkPlanExec`?

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