Apache Iceberg Rust version
0.6.0 (latest version)
Describe the bug
This is a bit pedantic but iceberg-rust uses partial_cmp for float/double comparison in the iceberg_float_cmp function, which treats -0.0 and +0.0 as equal, violating the function's own comments about the expected ordering.
The existing test test_iceberg_float_order uses assert_eq!, which cannot detect ordering differences between -0.0 and +0.0 since underlying f64(or f32) treats them as equal.
Using f64's total_cmp instead would likely fix this.
To Reproduce
#[test]
fn test_negative_zero_less_than_positive_zero() {
let neg_zero = Datum::float(-0.0);
let pos_zero = Datum::float(0.0);
assert_eq!(
neg_zero.partial_cmp(&pos_zero),
Some(Ordering::Less),
"IEEE 754 totalOrder requires -0.0 < +0.0"
);
}
Current: Some(Ordering::Equal)
Expected: Some(Ordering::Less)
Expected behavior
No response
Willingness to contribute
None
Apache Iceberg Rust version
0.6.0 (latest version)
Describe the bug
This is a bit pedantic but iceberg-rust uses
partial_cmpfor float/double comparison in theiceberg_float_cmpfunction, which treats -0.0 and +0.0 as equal, violating the function's own comments about the expected ordering.The existing test
test_iceberg_float_orderusesassert_eq!, which cannot detect ordering differences between -0.0 and +0.0 since underlying f64(or f32) treats them as equal.Using f64's
total_cmpinstead would likely fix this.To Reproduce
Current:
Some(Ordering::Equal)Expected:
Some(Ordering::Less)Expected behavior
No response
Willingness to contribute
None