kazuyukitanimura commented on a change in pull request #33721:
URL: https://github.com/apache/spark/pull/33721#discussion_r688809492



##########
File path: core/src/main/scala/org/apache/spark/MapOutputTracker.scala
##########
@@ -1335,22 +1334,23 @@ private[spark] object MapOutputTracker extends Logging {
     } {
       objOut.close()
     }
-    val arr = out.toByteArray
-    if (arr.length >= minBroadcastSize) {
+    // create a nested Array so that it can handle over 2GB serialized data
+    val arr = out.toChunkedByteBuffer.getChunks().map(_.array())
+    val arrSize = out.size
+    if (arrSize >= minBroadcastSize) {
       // Use broadcast instead.
       // Important arr(0) is the tag == DIRECT, ignore that while 
deserializing !
       val bcast = broadcastManager.newBroadcast(arr, isLocal)
-      // toByteArray creates copy, so we can reuse out
-      out.reset()
+      val out = new ChunkedByteBufferOutputStream(chunkSize, 
ByteBuffer.allocate _)

Review comment:
       Good point! updated.




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