jecsand838 commented on code in PR #9291:
URL: https://github.com/apache/arrow-rs/pull/9291#discussion_r2743805440
##########
arrow-avro/src/schema.rs:
##########
@@ -1357,11 +1357,57 @@ fn datatype_to_avro(
let val = match dt {
DataType::Null => Value::String("null".into()),
DataType::Boolean => Value::String("boolean".into()),
- DataType::Int8 | DataType::Int16 | DataType::UInt8 | DataType::UInt16
| DataType::Int32 => {
+ #[cfg(not(feature = "avro_custom_types"))]
Review Comment:
This was added because these are not native Avro types and now when
`#[cfg(feature = "avro_custom_types")]` we are annotating a custom
`logicalType` to the metadata. This enables easier round-tripping and optimal
compatibility with Arrow `DataType`'s.
##########
arrow-avro/src/reader/record.rs:
##########
@@ -952,9 +1246,9 @@ impl Decoder {
}
Self::Duration(builder) => {
let b = buf.get_fixed(12)?;
- let months = u32::from_le_bytes(b[0..4].try_into().unwrap());
- let days = u32::from_le_bytes(b[4..8].try_into().unwrap());
- let millis = u32::from_le_bytes(b[8..12].try_into().unwrap());
+ let months = u32::from_le_bytes([b[0], b[1], b[2], b[3]]);
+ let days = u32::from_le_bytes([b[4], b[5], b[6], b[7]]);
+ let millis = u32::from_le_bytes([b[8], b[9], b[10], b[11]]);
Review Comment:
Made this update to align with the newer code.
##########
arrow-avro/src/writer/mod.rs:
##########
@@ -3252,4 +3260,1631 @@ mod tests {
assert_eq!(expected_str, actual_str);
Ok(())
}
+
Review Comment:
Existing e2e tests are preserved to ensure backwards compatibility is
maintained.
--
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]