alamb commented on code in PR #9291:
URL: https://github.com/apache/arrow-rs/pull/9291#discussion_r2795232621
##########
arrow-avro/src/codec.rs:
##########
@@ -356,6 +356,56 @@ impl AvroDataType {
| Codec::DurationMicros
| Codec::DurationMillis
| Codec::DurationSeconds =>
AvroLiteral::Long(parse_json_i64(default_json, "long")?),
+ #[cfg(feature = "avro_custom_types")]
+ Codec::Int8 | Codec::Int16 => {
+ let i = parse_json_i64(default_json, "int")?;
+ if i < i32::MIN as i64 || i > i32::MAX as i64 {
+ return Err(ArrowError::SchemaError(format!(
+ "Default int {i} out of i32 range"
+ )));
+ }
+ AvroLiteral::Int(i as i32)
+ }
+ #[cfg(feature = "avro_custom_types")]
+ Codec::UInt8 | Codec::UInt16 => {
+ let i = parse_json_i64(default_json, "int")?;
+ if i < 0 || i > i32::MAX as i64 {
+ return Err(ArrowError::SchemaError(format!(
+ "Default unsigned int {i} out of range"
+ )));
+ }
+ AvroLiteral::Int(i as i32)
+ }
+ #[cfg(feature = "avro_custom_types")]
+ Codec::UInt32 | Codec::Date64 | Codec::TimeNanos |
Codec::TimestampSecs(_) => {
+ AvroLiteral::Long(parse_json_i64(default_json, "long")?)
Review Comment:
@berryve this seems like automated spam and the comment does not seem
relevant to this PR
--
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]