struct MinMaxStructState {
min_max: Vec<Option<StructArray>>,
data_type: DataType,
total_data_bytes: usize,
}Fields§
§min_max: Vec<Option<StructArray>>The minimum/maximum value for each group
data_type: DataTypeThe data type of the array
total_data_bytes: usizeThe total bytes of the string data (for pre-allocating the final array, and tracking memory usage)
Implementations§
Source§impl MinMaxStructState
Implement the MinMaxStructState with a comparison function
for comparing structs
impl MinMaxStructState
Implement the MinMaxStructState with a comparison function for comparing structs
Sourcefn new(data_type: DataType) -> Self
fn new(data_type: DataType) -> Self
Create a new MinMaxStructState
§Arguments:
data_type: The data type of the arrays that will be passed to this accumulator
Sourcefn set_value(&mut self, group_index: usize, new_val: &StructArray)
fn set_value(&mut self, group_index: usize, new_val: &StructArray)
Set the specified group to the given value, updating memory usage appropriately
Sourcefn update_batch<F>(
&mut self,
array: &StructArray,
group_indices: &[usize],
total_num_groups: usize,
cmp: F,
) -> Result<()>
fn update_batch<F>( &mut self, array: &StructArray, group_indices: &[usize], total_num_groups: usize, cmp: F, ) -> Result<()>
Updates the min/max values for the given string values
cmp is the comparison function to use, called like cmp(new_val, existing_val)
returns true if the new_val should replace existing_val
Sourcefn emit_to(&mut self, emit_to: EmitTo) -> (usize, Vec<Option<StructArray>>)
fn emit_to(&mut self, emit_to: EmitTo) -> (usize, Vec<Option<StructArray>>)
Emits the specified min_max values
Returns (data_capacity, min_maxes), updating the current value of total_data_bytes
data_capacity: the total length of all strings and their contents,min_maxes: the actual min/max values for each group
fn size(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MinMaxStructState
impl !RefUnwindSafe for MinMaxStructState
impl Send for MinMaxStructState
impl Sync for MinMaxStructState
impl Unpin for MinMaxStructState
impl !UnwindSafe for MinMaxStructState
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