diff --git a/src/array/list/mutable.rs b/src/array/list/mutable.rs index 8841ceaf53..2bb39dea87 100644 --- a/src/array/list/mutable.rs +++ b/src/array/list/mutable.rs @@ -142,6 +142,23 @@ impl MutableListArray { Self::new_from(values, data_type, capacity) } + /// Creates a new [`MutableListArray`] from a [`MutableArray`], [`Offsets`] and + /// [`MutableBitmap`]. + pub fn new_from_mutable( + values: M, + offsets: Offsets, + validity: Option, + ) -> Self { + assert_eq!(values.len(), offsets.last().to_usize()); + let data_type = values.data_type().clone(); + Self { + data_type, + offsets, + values, + validity, + } + } + #[inline] /// Needs to be called when a valid value was extended to this array. /// This is a relatively low level function, prefer `try_push` when you can.