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_r364252193
##########
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
Review comment:
just come up with this
```
case plan => !plan.requiredChildDistribution.forall(_ ==
UnspecifiedDistribution)
case _: Exchange => true
```
----------------------------------------------------------------
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]