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


##########
arrow-avro/src/reader/record.rs:
##########
@@ -644,6 +730,164 @@ impl Decoder {
                     "Default for duration long must be long".to_string(),
                 )),
             },
+            #[cfg(feature = "avro_custom_types")]
+            Self::Int8(v) => match lit {
+                AvroLiteral::Int(i) => {
+                    v.push(*i as i8);

Review Comment:
   Good callout. I went ahead and replaced these `as i8` / `as i16` / `as u8` / 
`as u16` conversions in `append_default` with checked conversions (`try_from`) 
and return an error when the default is out of range, instead of truncating.
   
   There are other ways to improve this that can be followed-up on.



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