alamb commented on code in PR #5852:
URL: https://github.com/apache/arrow-rs/pull/5852#discussion_r1634811175
##########
arrow-schema/src/field.rs:
##########
@@ -623,6 +645,69 @@ mod test {
assert_eq!(Field::new("c2", DataType::Utf8, true), field2);
}
+ #[test]
+ fn test_merge_with_nested_null() {
+ let mut struct1 = Field::new(
+ "s1",
+ DataType::Struct(Fields::from(vec![Field::new(
+ "inner",
+ DataType::Float32,
+ false,
+ )])),
+ false,
+ );
+
+ let struct2 = Field::new(
+ "s2",
+ DataType::Struct(Fields::from(vec![Field::new(
+ "inner",
+ DataType::Null,
+ false,
+ )])),
+ true,
+ );
+
+ struct1
+ .try_merge(&struct2)
+ .expect("should widen inner field's type to nullable float");
+ assert_eq!(
+ Field::new(
+ "s1",
+ DataType::Struct(Fields::from(vec![Field::new(
+ "inner",
+ DataType::Float32,
+ true,
+ )])),
+ true,
+ ),
+ struct1
+ );
+
+ let mut list1 = Field::new(
Review Comment:
Any chance we could add a test for `LargeList` too?
--
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]