mbutrovich commented on code in PR #19069:
URL: https://github.com/apache/iceberg/pull/19069#discussion_r4646808645


##########
format/spec.md:
##########
@@ -727,7 +727,7 @@ For details on how to serialize a sort order to JSON, see 
Appendix C.
 
 Order id `0` is reserved for the unsorted order.
 
-Sorting floating-point numbers should produce the following behavior: `-NaN` < 
`-Infinity` < `-value` < `-0` < `0` < `value` < `Infinity` < `NaN`. This aligns 
with the implementation of Java floating-point types comparisons.
+Sorting floating-point numbers should produce the following behavior: 
`-Infinity` < `-value` < `-0` < `0` < `value` < `Infinity` < `NaN`. All NaN bit 
patterns compare equal, including those with the sign bit set. This aligns with 
`Float.compare` and `Double.compare` in Java.

Review Comment:
   The default NaNs on x86 and AArch64 differ only in the sign bit, so under 
the current order the same computed value sorts first on one writer and last on 
the other. Comparing all NaNs as equal keeps a NaN's position from depending on 
the writer's CPU.



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

To unsubscribe, e-mail: [email protected]

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