JoshRosen commented on code in PR #45266:
URL: https://github.com/apache/spark/pull/45266#discussion_r1503532857


##########
core/src/main/scala/org/apache/spark/Dependency.scala:
##########
@@ -206,6 +206,21 @@ class ShuffleDependency[K: ClassTag, V: ClassTag, C: 
ClassTag](
     finalizeTask = Option(task)
   }
 
+  // Set the threshold to 1 billion which represents approximately 1GB of 
memory
+  // allocated to map output statuses.
+  // A large number of shuffle blocks may crash the driver with an OOM error.
+  private val SHUFFLE_BLOCK_NUMBER_WARNING_THRESHOLD: Long = 1000000000L
+  private val numberOfShuffleBlocks = numPartitions.toLong * 
partitioner.numPartitions.toLong
+
+  if (numberOfShuffleBlocks > SHUFFLE_BLOCK_NUMBER_WARNING_THRESHOLD) {
+    logWarning(
+      s"The number of shuffle blocks (${numberOfShuffleBlocks}) for ${_rdd} " +

Review Comment:
   Maybe we could also log the shuffle ID here as well? e.g. 
   
   ```
   "The number of shuffle blocks (...) for shuffleId $shuffleId for ${_rdd} 
with ${numPartition} partitions ...."
   ```
   
   or something along those lines?



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