cloud-fan commented on a change in pull request #33172:
URL: https://github.com/apache/spark/pull/33172#discussion_r662152464



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/ShufflePartitionsUtil.scala
##########
@@ -61,7 +63,9 @@ object ShufflePartitionsUtil extends Logging {
     // `maxTargetSize` from being set to 0.
     val maxTargetSize = math.max(
       math.ceil(totalPostShuffleInputSize / minNumPartitions.toDouble).toLong, 
16)
-    val targetSize = math.min(maxTargetSize, advisoryTargetSize)
+    // The target size can be very small if minNumPartitions is super big. 
Here we use
+    // minPartitionSize as the lower bound to avoid too small partitions after 
coalescing.
+    val targetSize = math.max(math.min(maxTargetSize, advisoryTargetSize), 
minPartitionSize)

Review comment:
       I don't have a strong opinion here. We can say that `minPartitionSize` 
larger than `advisoryTargetSize` is an ill pattern and we should forbid, or we 
just respect whatever user sets in for `minPartitionSize`




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