spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayousterhout <>
Subject [GitHub] spark pull request #17140: [SPARK-19796][CORE] Fix serialization of long pro...
Date Thu, 02 Mar 2017 19:53:53 GMT
Github user kayousterhout commented on a diff in the pull request:
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskDescription.scala ---
    @@ -86,7 +86,10 @@ private[spark] object TaskDescription {
         dataOut.writeInt( { case (key, value) =>
    -      dataOut.writeUTF(value)
    +      // SPARK-19796 -- writeUTF doesn't work for long strings, which can happen for
property values
    +      val bytes = value.getBytes("utf-8")
    +      dataOut.writeInt(bytes.length)
    +      dataOut.write(bytes)
    --- End diff --
    Can you just use .writeObject? I just read the code for this and it looks like that calls
writeUTF() under the hood when the string is short enough, and otherwise calls writeUTF a
few times.  It seems better to use that built-in than to try to do it ourselves.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message