srowen commented on issue #26548: [SPARK-29918][SQL] RecordBinaryComparator 
should check endianness when compared by long
URL: https://github.com/apache/spark/pull/26548#issuecomment-554650969
 
 
   BTW if we do make the compareUnsigned change, we could both optimize this 
bit of code while making it slightly more consistent:
   
   ```
           final int v1 = Platform.getByte(leftObj, leftOff + i) & 0xff;
           final int v2 = Platform.getByte(rightObj, rightOff + i) & 0xff;
           if (v1 != v2) {
             return v1 > v2 ? 1 : -1;
           }
   ```
   
   ```
           final int v1 = Platform.getByte(leftObj, leftOff + i);
           final int v2 = Platform.getByte(rightObj, rightOff + i);
           if (v1 != v2) {
             return (v1 & 0xff) > (v2 & 0xff) ? 1 : -1;
           }
   ```

----------------------------------------------------------------
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]


With regards,
Apache Git Services

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

Reply via email to