pub(crate) struct InProgressPrimitiveArray<T: ArrowPrimitiveType> {
data_type: DataType,
source: Option<ArrayRef>,
batch_size: usize,
nulls: NullBufferBuilder,
current: Vec<T::Native>,
}Expand description
InProgressArray for [PrimitiveArray]
Fields§
§data_type: DataTypeData type of the array
source: Option<ArrayRef>The current source, if any
batch_size: usizethe target batch size (and thus size for views allocation)
nulls: NullBufferBuilderIn progress nulls
current: Vec<T::Native>The currently in progress array
Implementations§
Source§impl<T: ArrowPrimitiveType> InProgressPrimitiveArray<T>
impl<T: ArrowPrimitiveType> InProgressPrimitiveArray<T>
Sourcepub(crate) fn new(batch_size: usize, data_type: DataType) -> Self
pub(crate) fn new(batch_size: usize, data_type: DataType) -> Self
Create a new InProgressPrimitiveArray
Sourcefn ensure_capacity(&mut self)
fn ensure_capacity(&mut self)
Allocate space for output values if necessary.
This is done on write (when we know it is necessary) rather than eagerly to avoid allocations that are not used.
Sourceunsafe fn append_values_by_indices(
current: &mut Vec<T::Native>,
values: &[T::Native],
indices: FilterIterator<Copied<Iter<'_, usize>>, IndexIterator<'_>>,
selected_count: usize,
)
unsafe fn append_values_by_indices( current: &mut Vec<T::Native>, values: &[T::Native], indices: FilterIterator<Copied<Iter<'_, usize>>, IndexIterator<'_>>, selected_count: usize, )
§Safety
Every index yielded by indices must be less than values.len(), and
indices must yield exactly selected_count indices.
Sourceunsafe fn append_values_by_slices(
current: &mut Vec<T::Native>,
values: &[T::Native],
slices: FilterIterator<Copied<Iter<'_, (usize, usize)>>, SlicesIterator<'_>>,
selected_count: usize,
)
unsafe fn append_values_by_slices( current: &mut Vec<T::Native>, values: &[T::Native], slices: FilterIterator<Copied<Iter<'_, (usize, usize)>>, SlicesIterator<'_>>, selected_count: usize, )
§Safety
Every range yielded by slices must satisfy
start <= end <= values.len(), and the ranges must contain exactly
selected_count values in total.
Trait Implementations§
Source§impl<T: Debug + ArrowPrimitiveType> Debug for InProgressPrimitiveArray<T>where
T::Native: Debug,
impl<T: Debug + ArrowPrimitiveType> Debug for InProgressPrimitiveArray<T>where
T::Native: Debug,
Source§impl<T: ArrowPrimitiveType + Debug> InProgressArray for InProgressPrimitiveArray<T>
impl<T: ArrowPrimitiveType + Debug> InProgressArray for InProgressPrimitiveArray<T>
Source§fn set_source(&mut self, source: Option<ArrayRef>)
fn set_source(&mut self, source: Option<ArrayRef>)
Set the source array. Read more
Source§fn copy_rows(&mut self, offset: usize, len: usize) -> Result<(), ArrowError>
fn copy_rows(&mut self, offset: usize, len: usize) -> Result<(), ArrowError>
Copy rows from the current source array into the in-progress array Read more
Source§fn copy_rows_by_filter(
&mut self,
filter: &FilterPredicate,
) -> Result<(), ArrowError>
fn copy_rows_by_filter( &mut self, filter: &FilterPredicate, ) -> Result<(), ArrowError>
Copy rows selected by
filter from the current source array. Read moreSource§fn finish(&mut self) -> Result<ArrayRef, ArrowError>
fn finish(&mut self) -> Result<ArrayRef, ArrowError>
Finish the currently in-progress array and return it as an
ArrayRefSource§fn copy_rows_by_filter_from(
&mut self,
source: ArrayRef,
filter: &FilterPredicate,
) -> Result<(), ArrowError>
fn copy_rows_by_filter_from( &mut self, source: ArrayRef, filter: &FilterPredicate, ) -> Result<(), ArrowError>
Source§fn copy_rows_by_selection(
&mut self,
selection: FilterSelection<'_>,
) -> Result<(), ArrowError>
fn copy_rows_by_selection( &mut self, selection: FilterSelection<'_>, ) -> Result<(), ArrowError>
Copy rows described by a
FilterSelection from the current source array. Read moreAuto Trait Implementations§
impl<T> !Freeze for InProgressPrimitiveArray<T>
impl<T> !RefUnwindSafe for InProgressPrimitiveArray<T>
impl<T> !UnwindSafe for InProgressPrimitiveArray<T>
impl<T> Forget for InProgressPrimitiveArray<T>
impl<T> Move for InProgressPrimitiveArray<T>
impl<T> Send for InProgressPrimitiveArray<T>
impl<T> Sync for InProgressPrimitiveArray<T>
impl<T> Unpin for InProgressPrimitiveArray<T>
impl<T> UnsafeUnpin for InProgressPrimitiveArray<T>where
Vec<<T as ArrowPrimitiveType>::Native>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more