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

Commit

Permalink
Add missing call to try_push_valid for nested avro deserialization (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
shaeqahmed committed Sep 16, 2022
1 parent b63329d commit c615095
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
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

0 comments on commit c615095

Please sign in to comment.