viirya commented on a change in pull request #838:
URL: https://github.com/apache/arrow-datafusion/pull/838#discussion_r684826624



##########
File path: datafusion/src/scalar.rs
##########
@@ -156,6 +157,58 @@ impl PartialEq for ScalarValue {
     }
 }
 
+// manual implementation of `PartialOrd` that uses OrderedFloat to
+// get defined behavior for floating point
+impl PartialOrd for ScalarValue {
+    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
+        use ScalarValue::*;
+        // This purposely doesn't have a catch-all "(_, _)" so that
+        // any newly added enum variant will require editing this list
+        // or else face a compile error

Review comment:
       Good suggestion! Updated.




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


Reply via email to