nathaniel-d-ef commented on code in PR #8298:
URL: https://github.com/apache/arrow-rs/pull/8298#discussion_r2344295861
##########
arrow-avro/src/writer/encoder.rs:
##########
@@ -171,15 +246,111 @@ impl<'a> FieldEncoder<'a> {
DataType::LargeBinary => {
Encoder::LargeBinary(BinaryEncoder(array.as_binary::<i64>()))
}
+ DataType::FixedSizeBinary(len) => {
+ // Decide between Avro `fixed` (raw bytes) and `uuid`
logical string
+ // based on Field metadata, mirroring schema generation
rules.
+ let arr = array
+ .as_any()
+ .downcast_ref::<FixedSizeBinaryArray>()
+ .ok_or_else(|| {
+ ArrowError::SchemaError("Expected
FixedSizeBinaryArray".into())
+ })?;
+ let md = field.metadata();
+ let is_uuid = md.get("logicalType").is_some_and(|v| v ==
"uuid")
+ || (*len == 16
+ && md.get("ARROW:extension:name").is_some_and(|v| v ==
"uuid"));
+ if is_uuid {
Review Comment:
Integrated this into the Uuid refactor 👍
--
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]