ueshin commented on code in PR #43321:
URL: https://github.com/apache/spark/pull/43321#discussion_r1353781026
##########
core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala:
##########
@@ -845,9 +843,7 @@ private[spark] class PythonRunner(
try {
stream.readInt() match {
case length if length > 0 =>
- val obj = new Array[Byte](length)
- stream.readFully(obj)
- obj
+ PythonWorkerUtils.readBytes(length, stream)
case 0 => Array.emptyByteArray
Review Comment:
That's a good point. I think we can include this in `readBytes` to always
avoid creating a new empty array.
--
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]