[
https://issues.apache.org/jira/browse/SPARK-3121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14163523#comment-14163523
]
Apache Spark commented on SPARK-3121:
-------------------------------------
User 'james64' has created a pull request for this issue:
https://github.com/apache/spark/pull/2712
> Wrong implementation of implicit bytesWritableConverter
> -------------------------------------------------------
>
> Key: SPARK-3121
> URL: https://issues.apache.org/jira/browse/SPARK-3121
> Project: Spark
> Issue Type: Bug
> Affects Versions: 1.0.2
> Reporter: Jakub Dubovsky
> Priority: Minor
>
> val path = ... //path to seq file with BytesWritable as type of both key and
> value
> val file = sc.sequenceFile[Array[Byte],Array[Byte]](path)
> file.take(1)(0)._1
> This prints incorrect content of byte array. Actual content starts with
> correct one and some "random" bytes and zeros are appended. BytesWritable has
> two methods:
> getBytes() - return content of all internal array which is often longer then
> actual value stored. It usually contains the rest of previous longer values
> copyBytes() - return just begining of internal array determined by internal
> length property
> It looks like in implicit conversion between BytesWritable and Array[byte]
> getBytes is used instead of correct copyBytes.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]