jecsand838 commented on code in PR #8254:
URL: https://github.com/apache/arrow-rs/pull/8254#discussion_r2312146709
##########
arrow-avro/src/reader/record.rs:
##########
@@ -590,10 +590,23 @@ impl Decoder {
)));
}
}
+ // Extract the value field nullability from the schema
+ let is_value_nullable = match map_field.data_type() {
+ DataType::Struct(fields) => fields
+ .iter()
+ .find(|f| f.name() == "value")
+ .map(|f| f.is_nullable())
+ .unwrap_or(false),
+ _ => true, // default to nullable
+ };
let entries_struct = StructArray::new(
Fields::from(vec![
Arc::new(ArrowField::new("key", DataType::Utf8,
false)),
- Arc::new(ArrowField::new("value",
val_arr.data_type().clone(), true)),
+ Arc::new(ArrowField::new(
+ "value",
+ val_arr.data_type().clone(),
+ is_value_nullable,
Review Comment:
I think there's value in the tests you wrote if you wanted to merge those
in.
##########
arrow-avro/src/reader/record.rs:
##########
@@ -590,10 +590,23 @@ impl Decoder {
)));
}
}
+ // Extract the value field nullability from the schema
+ let is_value_nullable = match map_field.data_type() {
+ DataType::Struct(fields) => fields
+ .iter()
+ .find(|f| f.name() == "value")
+ .map(|f| f.is_nullable())
+ .unwrap_or(false),
+ _ => true, // default to nullable
+ };
let entries_struct = StructArray::new(
Fields::from(vec![
Arc::new(ArrowField::new("key", DataType::Utf8,
false)),
- Arc::new(ArrowField::new("value",
val_arr.data_type().clone(), true)),
+ Arc::new(ArrowField::new(
+ "value",
+ val_arr.data_type().clone(),
+ is_value_nullable,
Review Comment:
I definitely think there's value in the tests you wrote if you wanted to
merge those in.
--
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]