You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Wenchen Fan (JIRA)" <ji...@apache.org> on 2017/07/06 06:49:00 UTC

[jira] [Resolved] (SPARK-21312) UnsafeRow writeToStream has incorrect offsetInByteArray calculation for non-zero offset

     [ https://issues.apache.org/jira/browse/SPARK-21312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wenchen Fan resolved SPARK-21312.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 2.1.2
                   2.3.0
                   2.2.1

Issue resolved by pull request 18535
[https://github.com/apache/spark/pull/18535]

> UnsafeRow writeToStream has incorrect offsetInByteArray calculation for non-zero offset
> ---------------------------------------------------------------------------------------
>
>                 Key: SPARK-21312
>                 URL: https://issues.apache.org/jira/browse/SPARK-21312
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.0.0, 2.1.0
>            Reporter: Sumedh Wale
>             Fix For: 2.2.1, 2.3.0, 2.1.2
>
>
> The following code in UnsafeRow has an incorrect offset calculation:
> {code}
>   public void writeToStream(OutputStream out, byte[] writeBuffer) throws IOException {
>     if (baseObject instanceof byte[]) {
>       int offsetInByteArray = (int) (Platform.BYTE_ARRAY_OFFSET - baseOffset);
> {code}
> which should be:
> {code}
>       int offsetInByteArray = (int) (baseOffset - Platform.BYTE_ARRAY_OFFSET);
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org