pub struct GroupValuesRows {
schema: SchemaRef,
row_converter: RowConverter,
map: HashTable<(u64, usize)>,
map_size: usize,
group_values: Option<Rows>,
hashes_buffer: Vec<u64>,
rows_buffer: Rows,
random_state: RandomState,
}Expand description
A GroupValues making use of [Rows]
This is a general implementation of GroupValues that works for any
combination of data types and number of columns, including nested types such as
structs and lists.
It uses the arrow-rs [Rows] to store the group values, which is a row-wise
representation.
Fields§
§schema: SchemaRefThe output schema
row_converter: RowConverterConverter for the group values
map: HashTable<(u64, usize)>Logically maps group values to a group_index in
Self::group_values and in each accumulator
Uses the raw API of hashbrown to avoid actually storing the keys (group values) in the table
keys: u64 hashes of the GroupValue values: (hash, group_index)
map_size: usizeThe size of map in bytes
group_values: Option<Rows>The actual group by values, stored in arrow Row format.
group_values[i] holds the group value for group_index i.
The row format is used to compare group keys quickly and store them efficiently in memory. Quick comparison is especially important for multi-column group keys.
hashes_buffer: Vec<u64>reused buffer to store hashes
rows_buffer: Rowsreused buffer to store rows
random_state: RandomStateRandom state for creating hashes
Implementations§
Trait Implementations§
Source§impl GroupValues for GroupValuesRows
impl GroupValues for GroupValuesRows
Source§fn intern(&mut self, cols: &[ArrayRef], groups: &mut Vec<usize>) -> Result<()>
fn intern(&mut self, cols: &[ArrayRef], groups: &mut Vec<usize>) -> Result<()>
cols, assigning new
group ids as necessary. Read moreSource§fn size(&self) -> usize
fn size(&self) -> usize
GroupValuesSource§fn is_empty(&self) -> bool
fn is_empty(&self) -> bool
GroupValues is emptySource§fn len(&self) -> usize
fn len(&self) -> usize
GroupValuesSource§fn clear_shrink(&mut self, batch: &RecordBatch)
fn clear_shrink(&mut self, batch: &RecordBatch)
Auto Trait Implementations§
impl Freeze for GroupValuesRows
impl RefUnwindSafe for GroupValuesRows
impl Send for GroupValuesRows
impl Sync for GroupValuesRows
impl Unpin for GroupValuesRows
impl UnwindSafe for GroupValuesRows
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more