cloud-fan commented on a change in pull request #25121: [SPARK-28356][SQL] Do
not reduce the number of partitions for repartition in adaptive execution
URL: https://github.com/apache/spark/pull/25121#discussion_r303279796
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/ReduceNumShufflePartitions.scala
##########
@@ -61,12 +61,16 @@ case class ReduceNumShufflePartitions(conf: SQLConf)
extends Rule[SparkPlan] {
// If not all leaf nodes are query stages, it's not safe to reduce the
number of
// shuffle partitions, because we may break the assumption that all
children of a spark plan
// have same number of output partitions.
+ return plan
+ }
+
+ val shuffleStages = plan.collect {
+ case stage: ShuffleQueryStageExec => stage
+ case ReusedQueryStageExec(_, stage: ShuffleQueryStageExec, _) => stage
+ }
+ if (!shuffleStages.forall(_.canChangeNumPartition)) {
Review comment:
add a comment to explain it?
----------------------------------------------------------------
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]