ulysses-you commented on a change in pull request #33123: URL: https://github.com/apache/spark/pull/33123#discussion_r660387330
########## File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/ShufflePartitionsUtil.scala ########## @@ -173,7 +176,11 @@ object ShufflePartitionsUtil extends Logging { if (numPartitions > start) { val partitionSpecs = coalescePartitions( partitionIndices(start), partitionIndices.last + 1, validMetrics, targetSize) - newPartitionSpecsSeq.zip(partitionSpecs).foreach(spec => spec._1 ++= spec._2) + assert(numPartitions > 0) + // skip empty partition iff all shuffle are empty after coalesced + if (!partitionSpecs.forall(specs => specs.size == 1 && specs.head.dataSize.contains(0))) { Review comment: SGTM ! -- 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. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org