Skip to main content

InProgressArray

Trait InProgressArray 

Source
trait InProgressArray:
    Debug
    + Send
    + Sync {
    // Required methods
    fn set_source(&mut self, source: Option<ArrayRef>);
    fn copy_rows(&mut self, offset: usize, len: usize) -> Result<(), ArrowError>;
    fn finish(&mut self) -> Result<ArrayRef, ArrowError>;
    fn size(&self) -> usize;

    // Provided methods
    fn copy_rows_by_filter(
        &mut self,
        filter: &FilterPredicate,
    ) -> Result<(), ArrowError> { ... }
    fn copy_rows_by_filter_from(
        &mut self,
        source: ArrayRef,
        filter: &FilterPredicate,
    ) -> Result<(), ArrowError> { ... }
    fn copy_rows_by_selection(
        &mut self,
        selection: FilterSelection<'_>,
    ) -> Result<(), ArrowError> { ... }
}
Expand description

Incrementally builds up arrays

GenericInProgressArray is the default implementation that buffers arrays, uses other kernels, and concatenates them when finished.

Some types have specialized, faster implementations (e.g., StringViewArray, etc.).

Required Methods§

Source

fn set_source(&mut self, source: Option<ArrayRef>)

Set the source array.

Calls to Self::copy_rows will copy rows from this array into the current in-progress array

Source

fn copy_rows(&mut self, offset: usize, len: usize) -> Result<(), ArrowError>

Copy rows from the current source array into the in-progress array

Note: The source array is set by Self::set_source.

Return an error if the source array is not set

Source

fn finish(&mut self) -> Result<ArrayRef, ArrowError>

Finish the currently in-progress array and return it as an ArrayRef

Source

fn size(&self) -> usize

Get the number of bytes this array is using

Provided Methods§

Source

fn copy_rows_by_filter( &mut self, filter: &FilterPredicate, ) -> Result<(), ArrowError>

Copy rows selected by filter from the current source array.

The default implementation calls Self::copy_rows_by_selection

Source

fn copy_rows_by_filter_from( &mut self, source: ArrayRef, filter: &FilterPredicate, ) -> Result<(), ArrowError>

Copy rows selected by a FilterPredicate from source.

Unlike the other copy methods, the source array is passed in directly, which allows implementations more flexibility. The default implementation simply sets source via Self::set_source and then calls Self::copy_rows_by_filter.

Source

fn copy_rows_by_selection( &mut self, selection: FilterSelection<'_>, ) -> Result<(), ArrowError>

Copy rows described by a FilterSelection from the current source array.

You typically get a FilterSelection from FilterPredicate::selection.

Note: The source array is set by Self::set_source.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§