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§
Sourcefn equal_to(
&self,
lhs_row: usize,
array: &Arc<dyn Array>,
rhs_row: usize,
) -> bool
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
Sourcefn append_val(
&mut self,
array: &Arc<dyn Array>,
row: usize,
) -> Result<(), DataFusionError>
fn append_val( &mut self, array: &Arc<dyn Array>, row: usize, ) -> Result<(), DataFusionError>
Appends the row at row in array to this builder
Sourcefn vectorized_equal_to(
&self,
lhs_rows: &[usize],
array: &Arc<dyn Array>,
rhs_rows: &[usize],
equal_to_results: &mut [bool],
)
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.
Sourcefn vectorized_append(
&mut self,
array: &Arc<dyn Array>,
rows: &[usize],
) -> Result<(), DataFusionError>
fn vectorized_append( &mut self, array: &Arc<dyn Array>, rows: &[usize], ) -> Result<(), DataFusionError>
The vectorized version append_val
Sourcefn size(&self) -> usize
fn size(&self) -> usize
Returns the number of bytes used by this GroupColumn