Creates a PrimitiveArray based on an iterator of values with provided nulls
(
iter: I,
nulls: Option<NullBuffer>,
)
| 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 { |