alamb commented on a change in pull request #9537:
URL: https://github.com/apache/arrow/pull/9537#discussion_r579790807



##########
File path: rust/arrow/src/datatypes/schema.rs
##########
@@ -279,6 +279,37 @@ impl Schema {
             )),
         }
     }
+
+    /// Check to see if `self` is a superset of `other` schema Here are the 
comparision rules:
+    ///
+    /// * for every field `f` in other, the field in self with corresponding 
index should be a

Review comment:
       👍  thank you for the clear comments

##########
File path: rust/datafusion/src/datasource/memory.rs
##########
@@ -365,4 +366,59 @@ mod tests {
 
         Ok(())
     }
+
+    #[tokio::test]
+    async fn test_merged_schema() -> Result<()> {
+        let mut metadata = HashMap::new();
+        metadata.insert("foo".to_string(), "bar".to_string());
+
+        let schema1 = Schema::new_with_metadata(
+            vec![
+                Field::new("a", DataType::Int32, false),

Review comment:
       I think this test should also include different numbers of fields in the 
two record batches (e.g. remove "c" from the first batch and remove "b" from 
the second) 




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