You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/08/08 18:43:41 UTC

[GitHub] [arrow-datafusion] houqp commented on a change in pull request #838: Implement PartialOrd for ScalarValue

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



##########
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:
       this comment doesn't seem to hold true anymore in this function, would be better to keep the same structure in `PartialEq` so we can also avoid catch all match here.




-- 
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-unsubscribe@arrow.apache.org

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