GroupColumn

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

    // 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: &ArrayRef, 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: &ArrayRef, row: usize) -> Result<()>

Appends the row at row in array to this builder

Source

fn vectorized_equal_to( &self, lhs_rows: &[usize], array: &ArrayRef, 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: &ArrayRef, rows: &[usize]) -> Result<()>

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>) -> ArrayRef

Builds a new array from all of the stored rows

Source

fn take_n(&mut self, n: usize) -> ArrayRef

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§

Source§

impl<B: ByteViewType> GroupColumn for ByteViewGroupValueBuilder<B>

Source§

impl<O> GroupColumn for ByteGroupValueBuilder<O>
where O: OffsetSizeTrait,

Source§

impl<T: ArrowPrimitiveType, const NULLABLE: bool> GroupColumn for PrimitiveGroupValueBuilder<T, NULLABLE>

Source§

impl<const NULLABLE: bool> GroupColumn for BooleanGroupValueBuilder<NULLABLE>