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


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/ShufflePartitionsUtil.scala:
##########
@@ -273,13 +309,22 @@ object ShufflePartitionsUtil extends Logging {
         j += 1
       }
 
-      // If including the `totalSizeOfCurrentPartition` would exceed the 
target size and the
-      // current size has reached the `minPartitionSize`, then start a new 
coalesced partition.
-      if (i > latestSplitPoint && coalescedSize + totalSizeOfCurrentPartition 
> targetSize) {
+      // The reducer-partition limit is a hard bound, so it takes precedence 
over the size-based
+      // packing and minimum partition size. Advance the split point even for 
an empty range so
+      // empty reducer partitions count toward the bound without creating an 
empty task.
+      if (i > latestSplitPoint &&
+          i - latestSplitPoint >= maxReducerPartitionsPerTask) {

Review Comment:
   Does this exceed the line width limit? Otherwise, let's not split when we 
can use one-liner.



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