tustvold commented on code in PR #4133:
URL: https://github.com/apache/arrow-datafusion/pull/4133#discussion_r1017444159


##########
datafusion/common/src/scalar.rs:
##########
@@ -132,15 +129,19 @@ impl PartialEq for ScalarValue {
             (Boolean(v1), Boolean(v2)) => v1.eq(v2),
             (Boolean(_), _) => false,
             (Float32(v1), Float32(v2)) => {
-                let v1 = v1.map(OrderedFloat);
-                let v2 = v2.map(OrderedFloat);
-                v1.eq(&v2)
+                // Handle NaN == NaN as true manually like in OrderedFloat
+                match (v1, v2) {
+                    (Some(f1), Some(f2)) if f1.is_nan() && f2.is_nan() => true,
+                    _ => v1.eq(v2),
+                }

Review Comment:
   ```suggestion
                   v1.to_bits() == v2.to_bits()
   ```



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to