jecsand838 commented on code in PR #8348:
URL: https://github.com/apache/arrow-rs/pull/8348#discussion_r2360030559


##########
arrow-avro/src/codec.rs:
##########
@@ -1149,6 +1345,67 @@ impl<'a> Maker<'a> {
             return self.resolve_primitives(write_primitive, read_primitive, 
reader_schema);
         }
         match (writer_schema, reader_schema) {
+            (Schema::Union(writer_variants), Schema::Union(reader_variants)) 
=> {
+                match (
+                    nullable_union_variants(writer_variants.as_slice()),
+                    nullable_union_variants(reader_variants.as_slice()),
+                ) {
+                    (Some((w_nb, w_nonnull)), Some((_r_nb, r_nonnull))) => {
+                        let mut dt = self.make_data_type(w_nonnull, 
Some(r_nonnull), namespace)?;
+                        dt.nullability = Some(w_nb);
+                        Ok(dt)
+                    }
+                    _ => self.resolve_unions(
+                        writer_variants.as_slice(),
+                        reader_variants.as_slice(),
+                        namespace,
+                    ),
+                }
+            }
+            (Schema::Union(writer_variants), reader_non_union) => {
+                let mut writer_to_reader: Vec<Option<(usize, Promotion)>> =
+                    Vec::with_capacity(writer_variants.len());

Review Comment:
   Thats a bad habit I have during development to keep track of types. I'll 
remove this as well.



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