MCPcopy Create free account
hub / github.com/apache/arrow-rs / from_iter_values_with_nulls

Method from_iter_values_with_nulls

arrow-array/src/array/primitive_array.rs:794–805  ·  view source on GitHub ↗

Creates a PrimitiveArray based on an iterator of values with provided nulls

(
        iter: I,
        nulls: Option<NullBuffer>,
    )

Source from the content-addressed store, hash-verified

792
793 /// Creates a PrimitiveArray based on an iterator of values with provided nulls
794 pub fn from_iter_values_with_nulls<I: IntoIterator<Item = T::Native>>(
795 iter: I,
796 nulls: Option<NullBuffer>,
797 ) -> Self {
798 let val_buf: Buffer = iter.into_iter().collect();
799 let len = val_buf.len() / std::mem::size_of::<T::Native>();
800 Self {
801 data_type: T::DATA_TYPE,
802 values: ScalarBuffer::new(val_buf, 0, len),
803 nulls,
804 }
805 }
806
807 /// Creates a PrimitiveArray based on a constant value with `count` elements
808 pub fn from_value(value: T::Native, count: usize) -> Self {

Callers

nothing calls this directly

Calls 3

collectMethod · 0.80
into_iterMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected