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

Improved MutableStruct::push #1223

Merged
merged 3 commits into from
Aug 17, 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
2 changes: 1 addition & 1 deletion src/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//! * [`Utf8Array`] and [`MutableUtf8Array`], an array of variable length utf8 values
//! * [`BinaryArray`] and [`MutableBinaryArray`], an array of opaque variable length values
//! * [`ListArray`] and [`MutableListArray`], an array of arrays (e.g. `[[1, 2], None, [], [None]]`)
//! * [`StructArray`], an array of arrays identified by a string (e.g. `{"a": [1, 2], "b": [true, false]}`)
//! * [`StructArray`] and [`MutableStructArray`], an array of arrays identified by a string (e.g. `{"a": [1, 2], "b": [true, false]}`)
//! All immutable arrays implement the trait object [`Array`] and that can be downcasted
//! to a concrete struct based on [`PhysicalType`](crate::datatypes::PhysicalType) available from [`Array::data_type`].
//! All immutable arrays are backed by [`Buffer`](crate::buffer::Buffer) and thus cloning and slicing them is `O(1)`.
Expand Down
6 changes: 1 addition & 5 deletions src/array/struct_/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,7 @@ impl MutableStructArray {
}
}

/// Call this after pushing into each child array.
/// # Panics
/// This function panics if any of the children does not have exactly one more
/// element than before the last call of `push`.
/// Call this once for each "row" of children you push.
pub fn push(&mut self, valid: bool) {
match &mut self.validity {
Some(validity) => validity.push(valid),
Expand All @@ -122,7 +119,6 @@ impl MutableStructArray {
false => self.init_validity(),
},
};
self.assert_lengths();
}

fn push_null(&mut self) {
Expand Down