viirya commented on a change in pull request #1469:
URL: https://github.com/apache/arrow-rs/pull/1469#discussion_r835961099



##########
File path: arrow/src/array/equal/utils.rs
##########
@@ -66,7 +66,14 @@ pub(super) fn equal_nulls(
 
 #[inline]
 pub(super) fn base_equal(lhs: &ArrayData, rhs: &ArrayData) -> bool {
-    lhs.data_type() == rhs.data_type() && lhs.len() == rhs.len()
+    let equal_type = match (lhs.data_type(), rhs.data_type()) {
+        (DataType::Union(l_fields, l_mode), DataType::Union(r_fields, r_mode)) 
=> {
+            // Defer field datatype check to `union_equal`

Review comment:
       Because even the lhs fields and rhs fields are different, the two union 
arrays are still possible equal. We cannot use fields to decide if two union 
arrays are equal or not. Fields and type_ids are co-related.




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