tustvold commented on code in PR #4042:
URL: https://github.com/apache/arrow-rs/pull/4042#discussion_r1161806455


##########
arrow-schema/src/datatype.rs:
##########
@@ -498,6 +498,29 @@ impl DataType {
                 }
             }
     }
+
+    /// Check to see if `self` is a superset of `other`
+    ///
+    /// If DataType is a nested type, then it will check to see if the nested 
type is a superset of the other nested type
+    /// else it will check to see if the DataType is equal to the other 
DataType
+    pub fn contains(&self, other: &DataType) -> bool {
+        match self {
+            DataType::List(field)
+            | DataType::LargeList(field)
+            | DataType::Map(field, _)
+            | DataType::FixedSizeList(field, _) => 
field.data_type().contains(other),

Review Comment:
   No, adding fields is not supported. I agree the name is perhaps unhelpful. 
It is basically used for testing if the layout of a given set of arrays is 
compatible



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