JeonDaehong commented on issue #3353:
URL: https://github.com/apache/iceberg-rust/issues/3353#issuecomment-6109026365

   I checked the Java side (Iceberg main `a5f4605`, JDK 21) to see how it 
handles this:
   
   * **Comparators:** `Comparators.forType` for float/double uses 
`naturalOrder()`. All NaNs compare equal (e.g., NaN vs. -NaN = 0, different 
payloads = 0) and sort above everything, including `-NaN vs. -Infinity = 1`.
   * **Equality & Ordering:** `Literal.equals` uses that comparator, so 
equality and ordering agree by construction.
   * **Sort Orders:** `SortOrderComparators` uses the same comparator, meaning 
Java sorts `-NaN` last, not first.
   * **Expressions:** Expressions reject NaN literals (e.g., 
`Expressions.lessThan("x", Float.NaN)` throws *"Cannot create expression 
literal from NaN"*). NaN goes through `isNaN`/`notNaN`, and bounds cannot be 
NaN.
   
   Based on this, matching Java would be the first option: treating every NaN 
as one value above everything. The spec line `-NaN < -Infinity < ... < NaN` 
states that it aligns with Java's comparison, but since Java's comparator 
doesn't actually distinguish `-NaN`, that line may be worth raising separately.


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