tobixdev commented on code in PR #8937:
URL: https://github.com/apache/arrow-rs/pull/8937#discussion_r2577663763


##########
arrow-schema/src/fields.rs:
##########
@@ -329,6 +329,28 @@ impl std::fmt::Debug for UnionFields {
     }
 }
 
+impl PartialEq for UnionFields {

Review Comment:
   I think this is a possible way of getting the desired behavior. We do have 
some mildly large unions (10-ish currently, but maybe more in the future) and I 
am a bit anxious on how the quadratic equality check will perform in practice, 
as the equality of a data type is often used when comparing fields, schemas, 
and logical plans.
   
   Another approach would be sorting the slice when constructing the instance. 
Maybe this would be an equally simple change with better performance as this 
already a private field.
   
   Note that I have no idea how this will actually perform as I have no 
benchmarks. Just my 2 cents. 
   
   Otherwise, this looks like a good change! 
   
    



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