cloud-fan commented on a change in pull request #26250: 
[SPARK-28560][SQL][followup] change the local shuffle reader from leaf node to 
unary node
URL: https://github.com/apache/spark/pull/26250#discussion_r339058196
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/ReduceNumShufflePartitions.scala
 ##########
 @@ -70,7 +70,8 @@ case class ReduceNumShufflePartitions(conf: SQLConf) extends 
Rule[SparkPlan] {
     }
     // ShuffleExchanges introduced by repartition do not support changing the 
number of partitions.
     // We change the number of partitions in the stage only if all the 
ShuffleExchanges support it.
-    if (!shuffleStages.forall(_.plan.canChangeNumPartitions)) {
 
 Review comment:
   We can change the logic of collecting shuffle stages:
   ```
   def collectShuffleStages(plan: SparkPlan): Seq[ShuffleQueryStageExec] = plan 
match {
     case _: LocalShuffleReaderExec = Nil
     case stage: ShuffleQueryStageExec => Seq(stage)
     case ReusedQueryStageExec(_, stage: ShuffleQueryStageExec, _) => 
Seq(stage) 
     case _ => plan.children.flatMap(collectShuffleStages)
   }
   
   val shuffleStages = collectShuffleStages(plan)
   ```

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