We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent caa0c79 commit f42726dCopy full SHA for f42726d
datafusion/datasource-avro/src/mod.rs
@@ -89,6 +89,20 @@ fn strip_metadata_from_data_type(data_type: &DataType) -> DataType {
89
DataType::Map(field, sorted) => {
90
DataType::Map(Arc::new(strip_metadata_from_field(field.as_ref())), *sorted)
91
}
92
+ DataType::Union(fields, mode) => {
93
+ let (type_ids, children): (Vec<_>, Vec<_>) = fields
94
+ .iter()
95
+ .map(|(type_id, field)| {
96
+ (*type_id, Arc::new(strip_metadata_from_field(field.as_ref())))
97
+ })
98
+ .unzip();
99
+
100
+ DataType::Union(
101
+ UnionFields::try_new(type_ids, children)
102
+ .expect("existing union fields should remain valid"),
103
+ *mode,
104
+ )
105
+ }
106
_ => data_type.clone(),
107
108
0 commit comments