GroupColumn

pub trait GroupColumn: Send + Sync {
    // Required methods
    fn equal_to(
        &self,
        lhs_row: usize,
        array: &Arc<dyn Array>,
        rhs_row: usize,
    ) -> bool;
    fn append_val(
        &mut self,
        array: &Arc<dyn Array>,
        row: usize,
    ) -> Result<(), DataFusionError>;
    fn vectorized_equal_to(
        &self,
        lhs_rows: &[usize],
        array: &Arc<dyn Array>,
        rhs_rows: &[usize],
        equal_to_results: &mut [bool],
    );
    fn vectorized_append(
        &mut self,
        array: &Arc<dyn Array>,
        rows: &[usize],
    ) -> Result<(), DataFusionError>;
    fn len(&self) -> usize;
    fn size(&self) -> usize;
    fn build(self: Box<Self>) -> Arc<dyn Array>;
    fn take_n(&mut self, n: usize) -> Arc<dyn Array>;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

Trait for storing a single column of group values in GroupValuesColumn

Implementations of this trait store an in-progress collection of group values (similar to various builders in Arrow-rs) that allow for quick comparison to incoming rows.

Required Methods§

Source

fn equal_to( &self, lhs_row: usize, array: &Arc<dyn Array>, rhs_row: usize, ) -> bool

Returns equal if the row stored in this builder at lhs_row is equal to the row in array at rhs_row

Note that this comparison returns true if both elements are NULL

Source

fn append_val( &mut self, array: &Arc<dyn Array>, row: usize, ) -> Result<(), DataFusionError>

Appends the row at row in array to this builder

Source

fn vectorized_equal_to( &self, lhs_rows: &[usize], array: &Arc<dyn Array>, rhs_rows: &[usize], equal_to_results: &mut [bool], )

The vectorized version equal to

When found nth row stored in this builder at lhs_row is equal to the row in array at rhs_row, it will record the true result at the corresponding position in equal_to_results.

And if found nth result in equal_to_results is already false, the check for nth row will be skipped.

Source

fn vectorized_append( &mut self, array: &Arc<dyn Array>, rows: &[usize], ) -> Result<(), DataFusionError>

The vectorized version append_val

Source

fn len(&self) -> usize

Returns the number of rows stored in this builder

Source

fn size(&self) -> usize

Returns the number of bytes used by this GroupColumn

Source

fn build(self: Box<Self>) -> Arc<dyn Array>

Builds a new array from all of the stored rows

Source

fn take_n(&mut self, n: usize) -> Arc<dyn Array>

Builds a new array from the first n stored rows, shifting the remaining rows to the start of the builder

Provided Methods§

Source

fn is_empty(&self) -> bool

true if len == 0

Implementors§