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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to