jecsand838 commented on code in PR #7889: URL: https://github.com/apache/arrow-rs/pull/7889#discussion_r2200978216
########## arrow-avro/src/codec.rs: ########## @@ -61,9 +61,25 @@ impl AvroDataType { } /// Returns an arrow [`Field`] with the given name + #[cfg(feature = "canonical_extension_types")] pub fn field_with_name(&self, name: &str) -> Field { - let d = self.codec.data_type(); - Field::new(name, d, self.nullability.is_some()).with_metadata(self.metadata.clone()) + let nullable = self.nullability.is_some(); + let data_type = self.codec.data_type(); + let field = match self.codec { + Codec::Uuid => Field::new(name, data_type, nullable) + .with_extension_type(arrow_schema::extension::Uuid), + _ => Field::new(name, data_type, nullable), + }; + field.with_metadata(self.metadata.clone()) + } + + /// Returns an arrow [`Field`] with the given name + #[cfg(not(feature = "canonical_extension_types"))] Review Comment: That's a much cleaner approach. I went ahead and pushed those changes 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org