dongjoon-hyun commented on code in PR #57087:
URL: https://github.com/apache/spark/pull/57087#discussion_r3539966553


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/ShufflePartitionsUtil.scala:
##########
@@ -48,7 +48,27 @@ object ShufflePartitionsUtil extends Logging {
       minNumPartitions: Int,
       minPartitionSize: Long,
       shuffleStageIds: Seq[Int] = Seq.empty): Seq[Seq[ShufflePartitionSpec]] = 
{
+    coalescePartitions(
+      mapOutputStatistics,
+      inputPartitionSpecs,
+      advisoryTargetSize,
+      minNumPartitions,
+      minPartitionSize,
+      shuffleStageIds,
+      Int.MaxValue)
+  }
+
+  def coalescePartitions(
+      mapOutputStatistics: Seq[Option[MapOutputStatistics]],
+      inputPartitionSpecs: Seq[Option[Seq[ShufflePartitionSpec]]],
+      advisoryTargetSize: Long,
+      minNumPartitions: Int,
+      minPartitionSize: Long,
+      shuffleStageIds: Seq[Int],
+      maxReducerPartitionsPerTask: Int): Seq[Seq[ShufflePartitionSpec]] = {
     assert(mapOutputStatistics.length == inputPartitionSpecs.length)
+    require(maxReducerPartitionsPerTask > 0,
+      "maxReducerPartitionsPerTask must be positive")

Review Comment:
   Since the configuration check already has this, maybe, can we skip this?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to