jayzhan211 commented on code in PR #5672:
URL: https://github.com/apache/arrow-rs/pull/5672#discussion_r1573504565
##########
arrow-ord/src/ord.rs:
##########
@@ -24,33 +24,107 @@ use arrow_buffer::ArrowNativeType;
use arrow_schema::ArrowError;
use std::cmp::Ordering;
+#[derive(Debug, PartialEq, Eq)]
+pub enum Compare {
+ Less,
+ Greater,
+ Equal,
+ LeftNull,
+ RightNull,
+ BothNull,
+}
+
+impl Compare {
+ pub fn ordering(&self, null_first: bool) -> Ordering {
+ match self {
+ Self::Less => Ordering::Less,
+ Self::Greater => Ordering::Greater,
+ Self::Equal => Ordering::Equal,
+ Self::LeftNull => {
+ if null_first {
+ Ordering::Less
+ } else {
+ Ordering::Greater
+ }
+ }
+ Self::RightNull => {
+ if null_first {
+ Ordering::Greater
+ } else {
+ Ordering::Less
+ }
+ }
+ Self::BothNull => Ordering::Equal,
+ }
+ }
+
+ #[inline]
+ pub fn is_null(&self) -> bool {
Review Comment:
Note: not used
--
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]