alamb commented on code in PR #7943:
URL: https://github.com/apache/arrow-rs/pull/7943#discussion_r2211598158


##########
parquet-variant/src/variant/object.rs:
##########
@@ -387,6 +389,31 @@ impl<'m, 'v> VariantObject<'m, 'v> {
     }
 }
 
+impl<'m, 'v> PartialEq for VariantObject<'m, 'v> {

Review Comment:
   Can you please add some comments explaining the rationale for why this is a 
custom derivation for future readers?
   
   Something ilke "Need custom partialEq implementation as field_ids may differ 
if metadata is different"



##########
parquet-variant/src/variant/object.rs:
##########
@@ -387,6 +389,31 @@ impl<'m, 'v> VariantObject<'m, 'v> {
     }
 }
 
+impl<'m, 'v> PartialEq for VariantObject<'m, 'v> {
+    fn eq(&self, other: &Self) -> bool {
+        let mut is_equal = self.metadata == other.metadata
+            && self.header == other.header
+            && self.num_elements == other.num_elements
+            && self.first_field_offset_byte == other.first_field_offset_byte
+            && self.first_value_byte == other.first_value_byte
+            && self.validated == other.validated;
+
+        // value validation

Review Comment:
   👍 
   
   We can probably add a fast path for the case when the metadata is actually 
the same and then we can just compare the field ids
   
   But that could also be done in a different PR



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