From c615095dbfb930a247c23423e36118843f71e1d2 Mon Sep 17 00:00:00 2001 From: Shaeq Ahmed Date: Fri, 16 Sep 2022 06:06:53 +0300 Subject: [PATCH] Add missing call to `try_push_valid` for nested avro deserialization (#1248) --- src/io/avro/read/deserialize.rs | 1 + src/io/avro/read/nested.rs | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/io/avro/read/deserialize.rs b/src/io/avro/read/deserialize.rs index 9fa9f152544..5f535650140 100644 --- a/src/io/avro/read/deserialize.rs +++ b/src/io/avro/read/deserialize.rs @@ -160,6 +160,7 @@ fn deserialize_value<'a>( let values = array.mut_values(index); block = deserialize_item(values, *is_nullable, &field.schema, block)?; } + array.try_push_valid()?; } _ => match data_type.to_physical_type() { PhysicalType::Boolean => { diff --git a/src/io/avro/read/nested.rs b/src/io/avro/read/nested.rs index 981b6894f9b..649a702ff9c 100644 --- a/src/io/avro/read/nested.rs +++ b/src/io/avro/read/nested.rs @@ -230,6 +230,14 @@ impl DynMutableStructArray { self.values[field].as_mut() } + #[inline] + pub fn try_push_valid(&mut self) -> Result<()> { + if let Some(validity) = &mut self.validity { + validity.push(true) + } + Ok(()) + } + #[inline] fn push_null(&mut self) { self.values.iter_mut().for_each(|x| x.push_null());