struct FirstPrimitiveGroupsAccumulator<T>where
T: ArrowPrimitiveType + Send,{
vals: Vec<T::Native>,
orderings: Vec<Vec<ScalarValue>>,
is_sets: BooleanBufferBuilder,
null_builder: BooleanBufferBuilder,
size_of_orderings: usize,
min_of_each_group_buf: (Vec<usize>, BooleanBufferBuilder),
ordering_req: LexOrdering,
pick_first_in_group: bool,
sort_options: Vec<SortOptions>,
ignore_nulls: bool,
data_type: DataType,
default_orderings: Vec<ScalarValue>,
}Fields§
§vals: Vec<T::Native>§orderings: Vec<Vec<ScalarValue>>§is_sets: BooleanBufferBuilder§null_builder: BooleanBufferBuilder§size_of_orderings: usize§min_of_each_group_buf: (Vec<usize>, BooleanBufferBuilder)§ordering_req: LexOrdering§pick_first_in_group: bool§sort_options: Vec<SortOptions>§ignore_nulls: bool§data_type: DataTypeThe output type
default_orderings: Vec<ScalarValue>Implementations§
Source§impl<T> FirstPrimitiveGroupsAccumulator<T>where
T: ArrowPrimitiveType + Send,
impl<T> FirstPrimitiveGroupsAccumulator<T>where
T: ArrowPrimitiveType + Send,
fn try_new( ordering_req: LexOrdering, ignore_nulls: bool, data_type: &DataType, ordering_dtypes: &[DataType], pick_first_in_group: bool, ) -> Result<Self>
fn should_update_state( &self, group_idx: usize, new_ordering_values: &[ScalarValue], ) -> Result<bool>
fn take_orderings(&mut self, emit_to: EmitTo) -> Vec<Vec<ScalarValue>>
fn take_need( bool_buf_builder: &mut BooleanBufferBuilder, emit_to: EmitTo, ) -> BooleanBuffer
fn resize_states(&mut self, new_size: usize)
fn update_state( &mut self, group_idx: usize, orderings: &[ScalarValue], new_val: T::Native, is_null: bool, )
fn take_state( &mut self, emit_to: EmitTo, ) -> (ArrayRef, Vec<Vec<ScalarValue>>, BooleanBuffer)
Sourcefn get_filtered_min_of_each_group(
&mut self,
orderings: &[ArrayRef],
group_indices: &[usize],
opt_filter: Option<&BooleanArray>,
vals: &PrimitiveArray<T>,
is_set_arr: Option<&BooleanArray>,
) -> Result<Vec<(usize, usize)>>
fn get_filtered_min_of_each_group( &mut self, orderings: &[ArrayRef], group_indices: &[usize], opt_filter: Option<&BooleanArray>, vals: &PrimitiveArray<T>, is_set_arr: Option<&BooleanArray>, ) -> Result<Vec<(usize, usize)>>
Returns a vector of tuples (group_idx, idx_in_val) representing the index of the
minimum value in orderings for each group, using lexicographical comparison.
Values are filtered using opt_filter and is_set_arr if provided.
TODO: rename to get_filtered_extreme_of_each_group
fn take_vals_and_null_buf(&mut self, emit_to: EmitTo) -> ArrayRef
Trait Implementations§
Source§impl<T> GroupsAccumulator for FirstPrimitiveGroupsAccumulator<T>where
T: ArrowPrimitiveType + Send,
impl<T> GroupsAccumulator for FirstPrimitiveGroupsAccumulator<T>where
T: ArrowPrimitiveType + Send,
Source§fn update_batch(
&mut self,
values_and_order_cols: &[ArrayRef],
group_indices: &[usize],
opt_filter: Option<&BooleanArray>,
total_num_groups: usize,
) -> Result<()>
fn update_batch( &mut self, values_and_order_cols: &[ArrayRef], group_indices: &[usize], opt_filter: Option<&BooleanArray>, total_num_groups: usize, ) -> Result<()>
Updates the accumulator’s state from its arguments, encoded as
a vector of [
ArrayRef]s. Read moreSource§fn evaluate(&mut self, emit_to: EmitTo) -> Result<ArrayRef>
fn evaluate(&mut self, emit_to: EmitTo) -> Result<ArrayRef>
Returns the final aggregate value for each group as a single
RecordBatch, resetting the internal state. Read moreSource§fn state(&mut self, emit_to: EmitTo) -> Result<Vec<ArrayRef>>
fn state(&mut self, emit_to: EmitTo) -> Result<Vec<ArrayRef>>
Returns the intermediate aggregate state for this accumulator,
used for multi-phase grouping, resetting its internal state. Read more
Source§fn merge_batch(
&mut self,
values: &[ArrayRef],
group_indices: &[usize],
opt_filter: Option<&BooleanArray>,
total_num_groups: usize,
) -> Result<()>
fn merge_batch( &mut self, values: &[ArrayRef], group_indices: &[usize], opt_filter: Option<&BooleanArray>, total_num_groups: usize, ) -> Result<()>
Merges intermediate state (the output from [
Self::state])
into this accumulator’s current state. Read moreSource§fn size(&self) -> usize
fn size(&self) -> usize
Amount of memory used to store the state of this accumulator,
in bytes. Read more
Source§fn supports_convert_to_state(&self) -> bool
fn supports_convert_to_state(&self) -> bool
Returns
true if [Self::convert_to_state] is implemented to support
intermediate aggregate state conversion.Auto Trait Implementations§
impl<T> Freeze for FirstPrimitiveGroupsAccumulator<T>
impl<T> !RefUnwindSafe for FirstPrimitiveGroupsAccumulator<T>
impl<T> Send for FirstPrimitiveGroupsAccumulator<T>
impl<T> Sync for FirstPrimitiveGroupsAccumulator<T>
impl<T> Unpin for FirstPrimitiveGroupsAccumulator<T>where
<T as ArrowPrimitiveType>::Native: Unpin,
impl<T> !UnwindSafe for FirstPrimitiveGroupsAccumulator<T>
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
Mutably borrows from an owned value. Read more
§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>
Converts
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>
Converts
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