yongkyunlee commented on code in PR #8254:
URL: https://github.com/apache/arrow-rs/pull/8254#discussion_r2312115413


##########
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:
   Thanks for the context. Should I close this PR if 
https://github.com/apache/arrow-rs/pull/8220 covers this issue?



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to