You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/07/29 07:14:45 UTC

[GitHub] [spark] viirya commented on a change in pull request #29259: [SPARK-29918][SQL][FOLLOWUP][TEST] Fix endianness issues in tests in RecordBinaryComparatorSuite

viirya commented on a change in pull request #29259:
URL: https://github.com/apache/spark/pull/29259#discussion_r461114124



##########
File path: sql/core/src/test/java/test/org/apache/spark/sql/execution/sort/RecordBinaryComparatorSuite.java
##########
@@ -261,40 +263,58 @@ public void testBinaryComparatorForNullColumns() throws Exception {
   public void testBinaryComparatorWhenSubtractionIsDivisibleByMaxIntValue() throws Exception {
     int numFields = 1;
 
+    long row1Data = 11L;
+    long row2Data = 11L + Integer.MAX_VALUE;
+
+    // BinaryComparator compares longs in big-endian byte order.

Review comment:
       Would you like to add few more words? It is a bit hard to reason about this with this only sentence.
   
   E.g. "... In little-endian sysyem, this bytes comparison does not overflow. We swap it to make sure overflow happened."

##########
File path: sql/core/src/test/java/test/org/apache/spark/sql/execution/sort/RecordBinaryComparatorSuite.java
##########
@@ -261,40 +263,58 @@ public void testBinaryComparatorForNullColumns() throws Exception {
   public void testBinaryComparatorWhenSubtractionIsDivisibleByMaxIntValue() throws Exception {
     int numFields = 1;
 
+    long row1Data = 11L;
+    long row2Data = 11L + Integer.MAX_VALUE;
+
+    // BinaryComparator compares longs in big-endian byte order.

Review comment:
       I think the overflow only happened when comparing longs? @mundaym




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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