GregBowyer commented on a change in pull request #8698:
URL: https://github.com/apache/arrow/pull/8698#discussion_r534652635



##########
File path: rust/parquet/src/data_type.rs
##########
@@ -229,6 +235,82 @@ impl fmt::Display for ByteArray {
     }
 }
 
+/// Wrapper type for performance reasons, this represents 
`FIXED_LEN_BYTE_ARRAY` but in all other
+/// considerations behaves the same as `ByteArray`
+#[repr(transparent)]
+#[derive(Clone, Debug, Default)]
+pub struct FixedLenByteArray(ByteArray);
+
+impl PartialEq for FixedLenByteArray {
+    fn eq(&self, other: &FixedLenByteArray) -> bool {
+        self.0.eq(&other.0)
+    }
+}
+
+impl PartialEq<ByteArray> for FixedLenByteArray {
+    fn eq(&self, other: &ByteArray) -> bool {
+        self.0.eq(other)
+    }
+}
+
+impl PartialEq<FixedLenByteArray> for ByteArray {
+    fn eq(&self, other: &FixedLenByteArray) -> bool {
+        self.eq(&other.0)
+    }
+}
+
+impl fmt::Display for FixedLenByteArray {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        self.0.fmt(f)
+    }
+}
+
+impl PartialOrd for FixedLenByteArray {
+    fn partial_cmp(&self, other: &FixedLenByteArray) -> Option<Ordering> {
+        self.0.partial_cmp(&other.0)
+    }
+}
+
+impl PartialOrd<FixedLenByteArray> for ByteArray {
+    fn partial_cmp(&self, other: &FixedLenByteArray) -> Option<Ordering> {
+        self.partial_cmp(&other.0)
+    }
+}
+
+impl PartialOrd<ByteArray> for FixedLenByteArray {
+    fn partial_cmp(&self, other: &ByteArray) -> Option<Ordering> {
+        self.0.partial_cmp(other)
+    }
+}
+
+use std::ops::{Deref, DerefMut};

Review comment:
       NIT: This should move to the top with the rest of the use statements.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to