You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by sumwale <gi...@git.apache.org> on 2017/07/05 07:07:32 UTC

[GitHub] spark pull request #18535: [SPARK-21312][SQL] correct UnsafeRow.writeToStrea...

GitHub user sumwale opened a pull request:

    https://github.com/apache/spark/pull/18535

    [SPARK-21312][SQL] correct UnsafeRow.writeToStream offsetInBytes

    ## What changes were proposed in this pull request?
    
    Corrects offsetInBytes calculation in UnsafeRow.writeToStream. Known failures include writes to some DataSources that have own SparkPlan implementations and cause EXCHANGE in writes.
    
    ## How was this patch tested?
    
    Extended UnsafeRowSuite.writeToStream to include an UnsafeRow over byte array having non-zero offset.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/sumwale/spark-contrib SPARK-21312

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/18535.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #18535
    
----
commit 2541615e6a66b0ba75e4f95d16a57c32d476ca0a
Author: Sumedh Wale <sw...@snappydata.io>
Date:   2016-12-01T09:50:06Z

    [SPARK-21312] correct offsetInBytes calculation
    
    - correct offsetInBytes in UnsafeRow.writeToStream
    - extended writeToStream test case in UnsafeRowSuite to include array with non-zero offset

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request #18535: [SPARK-21312][SQL] correct offsetInBytes in Unsaf...

Posted by kiszk <gi...@git.apache.org>.
Github user kiszk commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18535#discussion_r125867556
  
    --- Diff: sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java ---
    @@ -550,7 +550,7 @@ public void copyFrom(UnsafeRow row) {
        */
       public void writeToStream(OutputStream out, byte[] writeBuffer) throws IOException {
         if (baseObject instanceof byte[]) {
    -      int offsetInByteArray = (int) (Platform.BYTE_ARRAY_OFFSET - baseOffset);
    --- End diff --
    
    Yea, I understood why @sumwale added a new test with non-zero offset.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request #18535: [SPARK-21312][SQL] correct offsetInBytes in Unsaf...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/18535


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18535: [SPARK-21312][SQL] correct offsetInBytes in UnsafeRow.wr...

Posted by hvanhovell <gi...@git.apache.org>.
Github user hvanhovell commented on the issue:

    https://github.com/apache/spark/pull/18535
  
    ok to test


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18535: [SPARK-21312][SQL] correct offsetInBytes in UnsafeRow.wr...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18535
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/79217/
    Test PASSed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18535: [SPARK-21312][SQL] correct offsetInBytes in UnsafeRow.wr...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/18535
  
    Add to whitelist


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request #18535: [SPARK-21312][SQL] correct offsetInBytes in Unsaf...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18535#discussion_r125822004
  
    --- Diff: sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java ---
    @@ -550,7 +550,7 @@ public void copyFrom(UnsafeRow row) {
        */
       public void writeToStream(OutputStream out, byte[] writeBuffer) throws IOException {
         if (baseObject instanceof byte[]) {
    -      int offsetInByteArray = (int) (Platform.BYTE_ARRAY_OFFSET - baseOffset);
    --- End diff --
    
    i see, previously it only works if `baseOffset = Platform.BYTE_ARRAY_OFFSET`


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18535: [SPARK-21312][SQL] correct offsetInBytes in UnsafeRow.wr...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18535
  
    Merged build finished. Test PASSed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request #18535: [SPARK-21312][SQL] correct offsetInBytes in Unsaf...

Posted by sumwale <gi...@git.apache.org>.
Github user sumwale commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18535#discussion_r125827423
  
    --- Diff: sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java ---
    @@ -550,7 +550,7 @@ public void copyFrom(UnsafeRow row) {
        */
       public void writeToStream(OutputStream out, byte[] writeBuffer) throws IOException {
         if (baseObject instanceof byte[]) {
    -      int offsetInByteArray = (int) (Platform.BYTE_ARRAY_OFFSET - baseOffset);
    --- End diff --
    
    Right. Was a bit surprising that the non-zero offset case is not being hit in Spark otherwise. Seen when ingesting from parquet, for example, into a data source that has custom partitioning leading to a shuffle.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18535: [SPARK-21312][SQL] correct offsetInBytes in UnsafeRow.wr...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18535
  
    **[Test build #79217 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79217/testReport)** for PR 18535 at commit [`2541615`](https://github.com/apache/spark/commit/2541615e6a66b0ba75e4f95d16a57c32d476ca0a).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request #18535: [SPARK-21312][SQL] correct offsetInBytes in Unsaf...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18535#discussion_r125820178
  
    --- Diff: sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java ---
    @@ -550,7 +550,7 @@ public void copyFrom(UnsafeRow row) {
        */
       public void writeToStream(OutputStream out, byte[] writeBuffer) throws IOException {
         if (baseObject instanceof byte[]) {
    -      int offsetInByteArray = (int) (Platform.BYTE_ARRAY_OFFSET - baseOffset);
    --- End diff --
    
    hmmmm, so the `writeToStream` never worked before?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18535: [SPARK-21312][SQL] correct offsetInBytes in UnsafeRow.wr...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18535
  
    Can one of the admins verify this patch?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18535: [SPARK-21312][SQL] correct offsetInBytes in UnsafeRow.wr...

Posted by kiszk <gi...@git.apache.org>.
Github user kiszk commented on the issue:

    https://github.com/apache/spark/pull/18535
  
    LGTM


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18535: [SPARK-21312][SQL] correct offsetInBytes in UnsafeRow.wr...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18535
  
    **[Test build #79217 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79217/testReport)** for PR 18535 at commit [`2541615`](https://github.com/apache/spark/commit/2541615e6a66b0ba75e4f95d16a57c32d476ca0a).


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18535: [SPARK-21312][SQL] correct offsetInBytes in UnsafeRow.wr...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/18535
  
    thanks, merging to masetr/2.2/2.1!


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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