mundaym opened a new pull request #29259:
URL: https://github.com/apache/spark/pull/29259


   ### What changes were proposed in this pull request?
   PR #26548 means that RecordBinaryComparator now uses big endian
   byte order for long comparisons. However, this means that some of
   the constants in the regression tests no longer map to the same
   values in the comparison that they used to.
   
   For example, one of the tests does a comparison between
   Long.MIN_VALUE and 1 in order to trigger an overflow condition that
   existed in the past (i.e. Long.MIN_VALUE - 1). These constants
   correspond to the values 0x80..00 and 0x00..01. However on a
   little-endian machine the bytes in these values are now swapped
   before they are compared. This means that we will now be comparing
   0x00..80 with 0x01..00. 0x00..80 - 0x01..00 does not overflow
   therefore missing the original purpose of the test.
   
   To fix this the constants are now explicitly written out in big
   endian byte order to match the byte order used in the comparison.
   This also fixes the tests on big endian machines (which would
   otherwise get a different comparison result to the little-endian
   machines).
   
   ### Why are the changes needed?
   The regression tests no longer serve their initial purposes and also fail on 
big-endian systems.
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   ### How was this patch tested?
   Tests run on big-endian system (s390x).


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