We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1effe75 commit 0da9e82Copy full SHA for 0da9e82
sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/EnsureRequirements.scala
@@ -52,6 +52,8 @@ case class EnsureRequirements(conf: SQLConf) extends Rule[SparkPlan] {
52
case (child, distribution) =>
53
val numPartitions = distribution.requiredNumPartitions
54
.getOrElse(conf.numShufflePartitions)
55
+ // Like optimizer.CollapseRepartition removes adjacent repartition operations,
56
+ // adjacent repartitions performed by shuffle can be also removed.
57
val newChild = if (child.isInstanceOf[ShuffleExchangeExec]) child.children.head else child
58
ShuffleExchangeExec(distribution.createPartitioning(numPartitions), newChild)
59
}
0 commit comments