You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by jiangxb1987 <gi...@git.apache.org> on 2018/08/14 07:10:37 UTC

[GitHub] spark pull request #22101: [SPARK-23207][Core][FOLLOWUP] Fix RecordBinaryCom...

GitHub user jiangxb1987 opened a pull request:

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

    [SPARK-23207][Core][FOLLOWUP] Fix RecordBinaryComparator when subtraction between two words is divisible by Integer.MAX_VALUE.

    ## What changes were proposed in this pull request?
    
    https://github.com/apache/spark/pull/22079#discussion_r209705612 It is possible for two objects to be unequal and yet we consider them as equal with this code, if the long values are separated by Int.MaxValue.
    This PR fixes the issue.
    
    ## How was this patch tested?
    N/A


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

    $ git pull https://github.com/jiangxb1987/spark fix-rbc

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

    https://github.com/apache/spark/pull/22101.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 #22101
    
----
commit 1f6b2594ebe8b50e4cb2fcde15181cfa9a17f48c
Author: Xingbo Jiang <xi...@...>
Date:   2018-08-14T04:04:40Z

    fix

----


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

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


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

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


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

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


---

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


[GitHub] spark pull request #22101: [SPARK-23207][Core][FOLLOWUP] Fix RecordBinaryCom...

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

    https://github.com/apache/spark/pull/22101#discussion_r209860397
  
    --- Diff: sql/catalyst/src/main/java/org/apache/spark/sql/execution/RecordBinaryComparator.java ---
    @@ -42,16 +42,16 @@ public int compare(
           while ((leftOff + i) % 8 != 0 && i < leftLen) {
             res = (Platform.getByte(leftObj, leftOff + i) & 0xff) -
                     (Platform.getByte(rightObj, rightOff + i) & 0xff);
    -        if (res != 0) return res;
    +        if (res != 0) return (int) res;
    --- End diff --
    
    We can restrict scope of 'res' as an 'int' : and avoid the type promotions/conversions.


---

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


[GitHub] spark issue #22101: [SPARK-23207][Core][FOLLOWUP] Fix RecordBinaryComparator...

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

    https://github.com/apache/spark/pull/22101
  
    Merged build finished. Test FAILed.


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

    https://github.com/apache/spark/pull/22101
  
    Merged build finished. Test FAILed.


---

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


[GitHub] spark pull request #22101: [SPARK-23207][Core][FOLLOWUP] Fix RecordBinaryCom...

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

    https://github.com/apache/spark/pull/22101#discussion_r209855135
  
    --- Diff: sql/catalyst/src/main/java/org/apache/spark/sql/execution/RecordBinaryComparator.java ---
    @@ -42,16 +42,16 @@ public int compare(
           while ((leftOff + i) % 8 != 0 && i < leftLen) {
             res = (Platform.getByte(leftObj, leftOff + i) & 0xff) -
                     (Platform.getByte(rightObj, rightOff + i) & 0xff);
    -        if (res != 0) return res;
    +        if (res != 0) return (int) res;
             i += 1;
           }
         }
         // for architectures that support unaligned accesses, chew it up 8 bytes at a time
         if (Platform.unaligned() || (((leftOff + i) % 8 == 0) && ((rightOff + i) % 8 == 0))) {
           while (i <= leftLen - 8) {
    -        res = (int) ((Platform.getLong(leftObj, leftOff + i) -
    -                Platform.getLong(rightObj, rightOff + i)) % Integer.MAX_VALUE);
    -        if (res != 0) return res;
    +        res = Platform.getLong(leftObj, leftOff + i) -
    +                Platform.getLong(rightObj, rightOff + i);
    +        if (res != 0) return res > 0 ? 1 : -1;
    --- End diff --
    
    How about the following change to minimize and localize the change?
    ```
    long res = Platform.getLong(leftObj, leftOff + i) -
                 Platform.getLong(rightObj, rightOff + i);
    if (res != 0) return res > 0 ? 1 : -1;
    ```


---

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


[GitHub] spark issue #22101: [SPARK-23207][Core][FOLLOWUP] Fix RecordBinaryComparator...

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

    https://github.com/apache/spark/pull/22101
  
    **[Test build #94733 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/94733/testReport)** for PR 22101 at commit [`1f6b259`](https://github.com/apache/spark/commit/1f6b2594ebe8b50e4cb2fcde15181cfa9a17f48c).


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

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


---

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


[GitHub] spark issue #22101: [SPARK-23207][Core][FOLLOWUP] Fix RecordBinaryComparator...

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

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


---

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


[GitHub] spark issue #22101: [SPARK-23207][Core][FOLLOWUP] Fix RecordBinaryComparator...

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

    https://github.com/apache/spark/pull/22101
  
    **[Test build #94733 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/94733/testReport)** for PR 22101 at commit [`1f6b259`](https://github.com/apache/spark/commit/1f6b2594ebe8b50e4cb2fcde15181cfa9a17f48c).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

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


[GitHub] spark issue #22101: [SPARK-23207][Core][FOLLOWUP] Fix RecordBinaryComparator...

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

    https://github.com/apache/spark/pull/22101
  
    nit-picky detail -- I think this should get its own jira, since the original fix already went into a release.  Using the same jira again makes it hard to tell where this was fixed.


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

    https://github.com/apache/spark/pull/22101
  
    **[Test build #94803 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/94803/testReport)** for PR 22101 at commit [`9c1f486`](https://github.com/apache/spark/commit/9c1f4860ea794e60a127ae3ec2d1b518a182edf5).


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

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


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

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


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

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


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

    https://github.com/apache/spark/pull/22101
  
    Should there be a test, or do other sorting-related tests cover this indirectly?


---

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


[GitHub] spark issue #22101: [SPARK-23207][Core][FOLLOWUP] Fix RecordBinaryComparator...

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

    https://github.com/apache/spark/pull/22101
  
    cc @mridulm @squito 


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

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


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

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


---

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


[GitHub] spark pull request #22101: [SPARK-25114][Core] Fix RecordBinaryComparator wh...

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

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


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

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


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

    https://github.com/apache/spark/pull/22101
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/2212/
    Test PASSed.


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

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


---

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


[GitHub] spark issue #22101: [SPARK-23207][Core][FOLLOWUP] Fix RecordBinaryComparator...

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

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


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

    https://github.com/apache/spark/pull/22101
  
    Thanks! Merged to master and 2.3


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

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


---

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


[GitHub] spark pull request #22101: [SPARK-23207][Core][FOLLOWUP] Fix RecordBinaryCom...

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

    https://github.com/apache/spark/pull/22101#discussion_r209862610
  
    --- Diff: sql/catalyst/src/main/java/org/apache/spark/sql/execution/RecordBinaryComparator.java ---
    @@ -42,16 +42,16 @@ public int compare(
           while ((leftOff + i) % 8 != 0 && i < leftLen) {
             res = (Platform.getByte(leftObj, leftOff + i) & 0xff) -
                     (Platform.getByte(rightObj, rightOff + i) & 0xff);
    -        if (res != 0) return res;
    +        if (res != 0) return (int) res;
             i += 1;
           }
         }
         // for architectures that support unaligned accesses, chew it up 8 bytes at a time
         if (Platform.unaligned() || (((leftOff + i) % 8 == 0) && ((rightOff + i) % 8 == 0))) {
           while (i <= leftLen - 8) {
    -        res = (int) ((Platform.getLong(leftObj, leftOff + i) -
    -                Platform.getLong(rightObj, rightOff + i)) % Integer.MAX_VALUE);
    -        if (res != 0) return res;
    +        res = Platform.getLong(leftObj, leftOff + i) -
    +                Platform.getLong(rightObj, rightOff + i);
    +        if (res != 0) return res > 0 ? 1 : -1;
    --- End diff --
    
    The subtraction is buggy due to potential overflow.
    Why not simply use:
    ```
      final long v1 = Platform.getLong(leftObj, leftOff + i);
      final long v2 = Platform.getLong(rightObj, rightOff + i);
      if (v1 != v2) {
        return v1 > v2 ? -1 : 1;
      }
    ```


---

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


[GitHub] spark issue #22101: [SPARK-23207][Core][FOLLOWUP] Fix RecordBinaryComparator...

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

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


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

    https://github.com/apache/spark/pull/22101
  
    LGTM pending Xiao Li's excellent suggestion :-)


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

    https://github.com/apache/spark/pull/22101
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/2329/
    Test PASSed.


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

    https://github.com/apache/spark/pull/22101
  
    retest this please


---

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


[GitHub] spark issue #22101: [SPARK-23207][Core][FOLLOWUP] Fix RecordBinaryComparator...

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

    https://github.com/apache/spark/pull/22101
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/2176/
    Test PASSed.


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

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


---

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


[GitHub] spark pull request #22101: [SPARK-23207][Core][FOLLOWUP] Fix RecordBinaryCom...

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

    https://github.com/apache/spark/pull/22101#discussion_r209855589
  
    --- Diff: sql/catalyst/src/main/java/org/apache/spark/sql/execution/RecordBinaryComparator.java ---
    @@ -60,7 +60,7 @@ public int compare(
         while (i < leftLen) {
           res = (Platform.getByte(leftObj, leftOff + i) & 0xff) -
                   (Platform.getByte(rightObj, rightOff + i) & 0xff);
    -      if (res != 0) return res;
    +      if (res != 0) return (int) res;
    --- End diff --
    
    ditto


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

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


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

    https://github.com/apache/spark/pull/22101
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/2319/
    Test PASSed.


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

    https://github.com/apache/spark/pull/22101
  
    **[Test build #94953 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/94953/testReport)** for PR 22101 at commit [`ecb26fc`](https://github.com/apache/spark/commit/ecb26fc902995f866ee837f48c656cfb2174f18d).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

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


[GitHub] spark issue #22101: [SPARK-23207][Core][FOLLOWUP] Fix RecordBinaryComparator...

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

    https://github.com/apache/spark/pull/22101
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/2170/
    Test PASSed.


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

    https://github.com/apache/spark/pull/22101
  
    Thanks @squito I've added another test case to cover when the last byte differs. 


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

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


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

    https://github.com/apache/spark/pull/22101
  
    ping @gatorsmile @mridulm @squito 


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

    https://github.com/apache/spark/pull/22101
  
    the added tests are good.  This is pretty nit-picky, but looking at the whole test suite, are there any tests that check for anything other than the first byte (or array length)?  Seems the longer cases -- MultipleColumnRow, MixedColumns, ArrayColumn -- fail in a very early check.  NullColumn at least checks the last column.  kind of tedious test cases, but sometimes important in these low-level things as off-by-one errors are so easy.  (or maybe I just don't properly understand these test cases ...)
    
    anyway I don't think that needs to hold this up more, just some thoughts.  lgtm, thanks for working on this.


---

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


[GitHub] spark pull request #22101: [SPARK-25114][Core] Fix RecordBinaryComparator wh...

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

    https://github.com/apache/spark/pull/22101#discussion_r210043412
  
    --- Diff: sql/catalyst/src/main/java/org/apache/spark/sql/execution/RecordBinaryComparator.java ---
    @@ -27,7 +27,6 @@
       public int compare(
    --- End diff --
    
    Let us add a test suite for this function as you mentioned in the line 25. : )


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

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


---

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


[GitHub] spark pull request #22101: [SPARK-23207][Core][FOLLOWUP] Fix RecordBinaryCom...

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

    https://github.com/apache/spark/pull/22101#discussion_r209863964
  
    --- Diff: sql/catalyst/src/main/java/org/apache/spark/sql/execution/RecordBinaryComparator.java ---
    @@ -42,16 +42,16 @@ public int compare(
           while ((leftOff + i) % 8 != 0 && i < leftLen) {
             res = (Platform.getByte(leftObj, leftOff + i) & 0xff) -
                     (Platform.getByte(rightObj, rightOff + i) & 0xff);
    -        if (res != 0) return res;
    +        if (res != 0) return (int) res;
             i += 1;
           }
         }
         // for architectures that support unaligned accesses, chew it up 8 bytes at a time
         if (Platform.unaligned() || (((leftOff + i) % 8 == 0) && ((rightOff + i) % 8 == 0))) {
           while (i <= leftLen - 8) {
    -        res = (int) ((Platform.getLong(leftObj, leftOff + i) -
    -                Platform.getLong(rightObj, rightOff + i)) % Integer.MAX_VALUE);
    -        if (res != 0) return res;
    +        res = Platform.getLong(leftObj, leftOff + i) -
    +                Platform.getLong(rightObj, rightOff + i);
    +        if (res != 0) return res > 0 ? 1 : -1;
    --- End diff --
    
    +1 for no subtraction.


---

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


[GitHub] spark issue #22101: [SPARK-23207][Core][FOLLOWUP] Fix RecordBinaryComparator...

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

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


---

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


[GitHub] spark pull request #22101: [SPARK-23207][Core][FOLLOWUP] Fix RecordBinaryCom...

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

    https://github.com/apache/spark/pull/22101#discussion_r209855528
  
    --- Diff: sql/catalyst/src/main/java/org/apache/spark/sql/execution/RecordBinaryComparator.java ---
    @@ -42,16 +42,16 @@ public int compare(
           while ((leftOff + i) % 8 != 0 && i < leftLen) {
             res = (Platform.getByte(leftObj, leftOff + i) & 0xff) -
                     (Platform.getByte(rightObj, rightOff + i) & 0xff);
    -        if (res != 0) return res;
    +        if (res != 0) return (int) res;
    --- End diff --
    
    How about the following change to minimize and localize the change?
    ```
    int res = (Platform.getByte(leftObj, leftOff + i) & 0xff) -
                 (Platform.getByte(rightObj, rightOff + i) & 0xff);
    if (res != 0) return res;
    ```


---

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


[GitHub] spark issue #22101: [SPARK-25114][Core] Fix RecordBinaryComparator when subt...

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

    https://github.com/apache/spark/pull/22101
  
    @squito I've created a new JIRA task and updated the title, thanks for reminding!


---

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