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

[GitHub] spark pull request #18571: [SPARK-21344][SQL] BinaryType comparison does sig...

GitHub user kiszk opened a pull request:

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

    [SPARK-21344][SQL] BinaryType comparison does signed byte array comparison

    ## What changes were proposed in this pull request?
    
    This PR fixes a wrong comparison for `BinaryType`. This PR enables unsigned comparison for an array for `BinaryType`. Previous implementations uses signed comparison.
    
    ## How was this patch tested?
    
    Added a test suite in `OrderingSuite`.


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

    $ git pull https://github.com/kiszk/spark SPARK-21344

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

    https://github.com/apache/spark/pull/18571.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 #18571
    
----
commit ac86eedfc36ca85b1f89b2aee48219f15167a1b3
Author: Kazuaki Ishizaki <is...@jp.ibm.com>
Date:   2017-07-08T09:15:32Z

    initial commit

----


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    IIUC, `BinaryType` should be handled as unsigned byte while Java and Scala have only signed byte array.
    That is why we have to do unsigned comparison of `BinaryType`.
    The places where byte comparison is used rather than for `BinaryType`, I think that we do not change comparisons.
    
    What do you think?
    cc: @gatorsmile 


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    **[Test build #79612 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79612/testReport)** for PR 18571 at commit [`08776e1`](https://github.com/apache/spark/commit/08776e1931ee21e5200a977efd0aa379ae448033).
     * 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 issue #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

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


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    **[Test build #79612 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79612/testReport)** for PR 18571 at commit [`08776e1`](https://github.com/apache/spark/commit/08776e1931ee21e5200a977efd0aa379ae448033).


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    ```SQL
    SELECT x'00' < x'0f'
    SELECT x'00' < x'ff'
    ```
    
    Could you add the above queries to a new `comparator.sql` file? 


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    @gatorsmile could you please review this?


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does sig...

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

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


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does sig...

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

    https://github.com/apache/spark/pull/18571#discussion_r127402954
  
    --- Diff: common/unsafe/src/main/java/org/apache/spark/unsafe/types/ByteArray.java ---
    @@ -44,7 +44,7 @@ public static long getPrefix(byte[] bytes) {
           final int minLen = Math.min(bytes.length, 8);
           long p = 0;
           for (int i = 0; i < minLen; ++i) {
    -        p |= (128L + Platform.getByte(bytes, Platform.BYTE_ARRAY_OFFSET + i))
    +        p |= ((long) Platform.getByte(bytes, Platform.BYTE_ARRAY_OFFSET + i) & 0xff)
    --- End diff --
    
    Seems we don't have unit test for this. Shall we add a ByteArraySuite?


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    **[Test build #79439 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79439/testReport)** for PR 18571 at commit [`a84776b`](https://github.com/apache/spark/commit/a84776b508998a3cfd555aa8db242f694f405bc9).
     * This patch **fails due to an unknown error code, -9**.
     * 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 issue #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

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


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    Jenkins, retest this please.


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/79450/
    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 #18571: [SPARK-21344][SQL] BinaryType comparison does sig...

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

    https://github.com/apache/spark/pull/18571#discussion_r126314765
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/OrderingSuite.scala ---
    @@ -137,4 +137,22 @@ class OrderingSuite extends SparkFunSuite with ExpressionEvalHelper {
         // verify that we can support up to 5000 ordering comparisons, which should be sufficient
         GenerateOrdering.generate(Array.fill(5000)(sortOrder))
       }
    +
    +  test("SPARK-21344: BinaryType comparison does signed byte array comparison") {
    +    val b1 = Array[Byte](1)   // 0x01
    +    val b2 = Array[Byte](-1)  // 0xff
    --- End diff --
    
    Hi, @kiszk 
    Can we have another test case with more than one byte for code coverage?


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    **[Test build #79381 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79381/testReport)** for PR 18571 at commit [`ac86eed`](https://github.com/apache/spark/commit/ac86eedfc36ca85b1f89b2aee48219f15167a1b3).
     * This patch **fails Spark unit 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 issue #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

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


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    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 issue #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    **[Test build #79600 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79600/testReport)** for PR 18571 at commit [`e33ec8e`](https://github.com/apache/spark/commit/e33ec8e7661080a98e657363682b83ec48601a9d).
     * 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 issue #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    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 #18571: [SPARK-21344][SQL] BinaryType comparison does sig...

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

    https://github.com/apache/spark/pull/18571#discussion_r127396793
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/OrderingSuite.scala ---
    @@ -137,4 +137,26 @@ class OrderingSuite extends SparkFunSuite with ExpressionEvalHelper {
         // verify that we can support up to 5000 ordering comparisons, which should be sufficient
         GenerateOrdering.generate(Array.fill(5000)(sortOrder))
       }
    +
    +  test("SPARK-21344: BinaryType comparison does signed byte array comparison") {
    +    val data = Seq(
    +      (Array[Byte](1), Array[Byte](-1)),
    +      (Array[Byte](1, 1, 1, 1, 1), Array[Byte](1, 1, 1, 1, -1)),
    +      (Array[Byte](1, 1, 1, 1, 1, 1, 1, 1, 1), Array[Byte](1, 1, 1, 1, 1, 1, 1, 1, -1))
    +      )
    +    data.foreach { case (b1, b2) =>
    +      val rowOrdering = InterpretedOrdering.forSchema(Seq(BinaryType, BinaryType))
    +      val genOrdering = GenerateOrdering.generate(
    +        BoundReference(0, BinaryType, nullable = true).asc ::
    +          BoundReference(1, BinaryType, nullable = true).asc :: Nil)
    +      val rowType = StructType(
    +        StructField("b1", BinaryType, nullable = true) ::
    +          StructField("b2", BinaryType, nullable = true) :: Nil)
    --- End diff --
    
    You specify two binary fields as row schema. But actually your input just has one binary field (i.e., Row(b1)).


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/79612/
    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 #18571: [SPARK-21344][SQL] BinaryType comparison does sig...

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

    https://github.com/apache/spark/pull/18571#discussion_r126335033
  
    --- Diff: common/unsafe/src/main/java/org/apache/spark/unsafe/types/ByteArray.java ---
    @@ -44,7 +44,7 @@ public static long getPrefix(byte[] bytes) {
           final int minLen = Math.min(bytes.length, 8);
           long p = 0;
           for (int i = 0; i < minLen; ++i) {
    -        p |= (128L + Platform.getByte(bytes, Platform.BYTE_ARRAY_OFFSET + i))
    +        p |= ((long)Platform.getByte(bytes, Platform.BYTE_ARRAY_OFFSET + i) & 0xff)
    --- End diff --
    
    Nit: maybe we need a single space like `((long) Platform...`.


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does sig...

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

    https://github.com/apache/spark/pull/18571#discussion_r127493922
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/OrderingSuite.scala ---
    @@ -137,4 +137,26 @@ class OrderingSuite extends SparkFunSuite with ExpressionEvalHelper {
         // verify that we can support up to 5000 ordering comparisons, which should be sufficient
         GenerateOrdering.generate(Array.fill(5000)(sortOrder))
       }
    +
    +  test("SPARK-21344: BinaryType comparison does signed byte array comparison") {
    +    val data = Seq(
    +      (Array[Byte](1), Array[Byte](-1)),
    +      (Array[Byte](1, 1, 1, 1, 1), Array[Byte](1, 1, 1, 1, -1)),
    +      (Array[Byte](1, 1, 1, 1, 1, 1, 1, 1, 1), Array[Byte](1, 1, 1, 1, 1, 1, 1, 1, -1))
    +      )
    +    data.foreach { case (b1, b2) =>
    +      val rowOrdering = InterpretedOrdering.forSchema(Seq(BinaryType, BinaryType))
    --- End diff --
    
    Good catch, updated.


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    **[Test build #79425 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79425/testReport)** for PR 18571 at commit [`0fea784`](https://github.com/apache/spark/commit/0fea784ba014e9a0e6cb693f43d5b33a62e134c0).
     * This patch **fails Spark unit 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 #18571: [SPARK-21344][SQL] BinaryType comparison does sig...

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

    https://github.com/apache/spark/pull/18571#discussion_r126335991
  
    --- Diff: common/unsafe/src/main/java/org/apache/spark/unsafe/types/ByteArray.java ---
    @@ -44,7 +44,7 @@ public static long getPrefix(byte[] bytes) {
           final int minLen = Math.min(bytes.length, 8);
           long p = 0;
           for (int i = 0; i < minLen; ++i) {
    -        p |= (128L + Platform.getByte(bytes, Platform.BYTE_ARRAY_OFFSET + i))
    +        p |= ((long)Platform.getByte(bytes, Platform.BYTE_ARRAY_OFFSET + i) & 0xff)
    --- End diff --
    
    good catch. done.


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

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


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does sig...

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

    https://github.com/apache/spark/pull/18571#discussion_r126335167
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/OrderingSuite.scala ---
    @@ -137,4 +137,22 @@ class OrderingSuite extends SparkFunSuite with ExpressionEvalHelper {
         // verify that we can support up to 5000 ordering comparisons, which should be sufficient
         GenerateOrdering.generate(Array.fill(5000)(sortOrder))
       }
    +
    +  test("SPARK-21344: BinaryType comparison does signed byte array comparison") {
    +    val b1 = Array[Byte](1)   // 0x01
    +    val b2 = Array[Byte](-1)  // 0xff
    --- End diff --
    
    Also, it looks better to check the boundary values like `-128` and  `127`.


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    Thanks! Merging to master/2.2/2.1/2.0


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

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


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    **[Test build #79436 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79436/testReport)** for PR 18571 at commit [`814d4c4`](https://github.com/apache/spark/commit/814d4c41235000da5b8e758576de431c3faa43ad).


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

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


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    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 issue #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

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


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    **[Test build #79425 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79425/testReport)** for PR 18571 at commit [`0fea784`](https://github.com/apache/spark/commit/0fea784ba014e9a0e6cb693f43d5b33a62e134c0).


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    I checked other dbms (dbms-like) systems handled binary as unassigned;
    ```
    postgres=# SELECT E'\\x00'::BYTEA < E'\\xff'::BYTEA;
     ?column? 
    ----------
     t
    (1 row)
    
    hive> SELECT unhex('00') < unhex('ff');
    OK
    true
    
    mysql> SELECT x'00' < x'ff';
    +---------------+
    | x'00' < x'ff' |
    +---------------+
    |             1 |
    +---------------+
    ```
    
    In some parts of the Spark implementation, they also handle binary as unassigned (https://github.com/apache/spark/blob/master/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/PrefixComparators.java#L36). I feel, based on the principle of least astonishment, we'd be better to handle binary as unassigned in user-facing pieces.


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    @gatorsmile thank you for your comment, done


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

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


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

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


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

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


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/79600/
    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 #18571: [SPARK-21344][SQL] BinaryType comparison does sig...

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

    https://github.com/apache/spark/pull/18571#discussion_r127396588
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/OrderingSuite.scala ---
    @@ -137,4 +137,26 @@ class OrderingSuite extends SparkFunSuite with ExpressionEvalHelper {
         // verify that we can support up to 5000 ordering comparisons, which should be sufficient
         GenerateOrdering.generate(Array.fill(5000)(sortOrder))
       }
    +
    +  test("SPARK-21344: BinaryType comparison does signed byte array comparison") {
    +    val data = Seq(
    +      (Array[Byte](1), Array[Byte](-1)),
    +      (Array[Byte](1, 1, 1, 1, 1), Array[Byte](1, 1, 1, 1, -1)),
    +      (Array[Byte](1, 1, 1, 1, 1, 1, 1, 1, 1), Array[Byte](1, 1, 1, 1, 1, 1, 1, 1, -1))
    +      )
    +    data.foreach { case (b1, b2) =>
    +      val rowOrdering = InterpretedOrdering.forSchema(Seq(BinaryType, BinaryType))
    --- End diff --
    
    hmmm, don't you just have one binary field for each row? Why you specify two fields to compare?


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    It sounds like all the comments from @viirya have been resolved. Will merge it tonight. Thanks!


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does sig...

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

    https://github.com/apache/spark/pull/18571#discussion_r126335091
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/OrderingSuite.scala ---
    @@ -137,4 +137,22 @@ class OrderingSuite extends SparkFunSuite with ExpressionEvalHelper {
         // verify that we can support up to 5000 ordering comparisons, which should be sufficient
         GenerateOrdering.generate(Array.fill(5000)(sortOrder))
       }
    +
    +  test("SPARK-21344: BinaryType comparison does signed byte array comparison") {
    +    val b1 = Array[Byte](1)   // 0x01
    +    val b2 = Array[Byte](-1)  // 0xff
    --- End diff --
    
    Thank you for your comment, done.


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    Aren't byte comparisons signed though elsewhere? as well as other integer type comparison? this would become inconsistent. Maybe I'm missing the reason this should be different.


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

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


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does sig...

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

    https://github.com/apache/spark/pull/18571#discussion_r127493964
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/OrderingSuite.scala ---
    @@ -137,4 +137,26 @@ class OrderingSuite extends SparkFunSuite with ExpressionEvalHelper {
         // verify that we can support up to 5000 ordering comparisons, which should be sufficient
         GenerateOrdering.generate(Array.fill(5000)(sortOrder))
       }
    +
    +  test("SPARK-21344: BinaryType comparison does signed byte array comparison") {
    +    val data = Seq(
    +      (Array[Byte](1), Array[Byte](-1)),
    +      (Array[Byte](1, 1, 1, 1, 1), Array[Byte](1, 1, 1, 1, -1)),
    +      (Array[Byte](1, 1, 1, 1, 1, 1, 1, 1, 1), Array[Byte](1, 1, 1, 1, 1, 1, 1, 1, -1))
    +      )
    +    data.foreach { case (b1, b2) =>
    +      val rowOrdering = InterpretedOrdering.forSchema(Seq(BinaryType, BinaryType))
    +      val genOrdering = GenerateOrdering.generate(
    +        BoundReference(0, BinaryType, nullable = true).asc ::
    +          BoundReference(1, BinaryType, nullable = true).asc :: Nil)
    +      val rowType = StructType(
    +        StructField("b1", BinaryType, nullable = true) ::
    +          StructField("b2", BinaryType, nullable = true) :: Nil)
    --- End diff --
    
    I misunderstood, updated.


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    **[Test build #79450 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79450/testReport)** for PR 18571 at commit [`a84776b`](https://github.com/apache/spark/commit/a84776b508998a3cfd555aa8db242f694f405bc9).
     * 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 #18571: [SPARK-21344][SQL] BinaryType comparison does sig...

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

    https://github.com/apache/spark/pull/18571#discussion_r127494315
  
    --- Diff: common/unsafe/src/main/java/org/apache/spark/unsafe/types/ByteArray.java ---
    @@ -44,7 +44,7 @@ public static long getPrefix(byte[] bytes) {
           final int minLen = Math.min(bytes.length, 8);
           long p = 0;
           for (int i = 0; i < minLen; ++i) {
    -        p |= (128L + Platform.getByte(bytes, Platform.BYTE_ARRAY_OFFSET + i))
    +        p |= ((long) Platform.getByte(bytes, Platform.BYTE_ARRAY_OFFSET + i) & 0xff)
    --- End diff --
    
    We have [the unit test](https://github.com/kiszk/spark/blob/08776e1931ee21e5200a977efd0aa379ae448033/core/src/test/scala/org/apache/spark/util/collection/unsafe/sort/PrefixComparatorsSuite.scala#L62-L115) for this. I added some cases.


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    @maropu, thank you for your comment.


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

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


---
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 #18571: [SPARK-21344][SQL] BinaryType comparison does signed byt...

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

    https://github.com/apache/spark/pull/18571
  
    **[Test build #79436 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79436/testReport)** for PR 18571 at commit [`814d4c4`](https://github.com/apache/spark/commit/814d4c41235000da5b8e758576de431c3faa43ad).
     * This patch **fails due to an unknown error code, -9**.
     * 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