Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Add missing call to try_push_valid for nested avro deserialization #1248

Merged
merged 6 commits into from
Sep 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/io/avro/read/deserialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
8 changes: 8 additions & 0 deletions src/io/avro/read/nested.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down