struct SkipAggregationProbe {
probe_rows_threshold: usize,
probe_ratio_threshold: f64,
input_rows: usize,
num_groups: usize,
should_skip: bool,
is_locked: bool,
skipped_aggregation_rows: Count,
}Expand description
Tracks if the aggregate should skip partial aggregations
See “partial aggregation” discussion on GroupedHashAggregateStream
Fields§
§probe_rows_threshold: usizeAggregation ratio check performed when the number of input rows exceeds
this threshold (from SessionConfig)
probe_ratio_threshold: f64Maximum ratio of num_groups to input_rows for continuing aggregation
(from SessionConfig). If the ratio exceeds this value, aggregation
is skipped and input rows are directly converted to output
input_rows: usizeNumber of processed input rows (updated during probing)
num_groups: usizeNumber of total group values for input_rows (updated during probing)
should_skip: boolFlag indicating further data aggregation may be skipped (decision made when probing complete)
is_locked: boolFlag indicating further updates of SkipAggregationProbe state won’t
make any effect (set either while probing or on probing completion)
skipped_aggregation_rows: CountNumber of rows where state was output without aggregation.
-
If 0, all input rows were aggregated (should_skip was always false)
-
if greater than zero, the number of rows which were output directly without aggregation
Implementations§
Source§impl SkipAggregationProbe
impl SkipAggregationProbe
fn new( probe_rows_threshold: usize, probe_ratio_threshold: f64, skipped_aggregation_rows: Count, ) -> Self
Sourcefn update_state(&mut self, input_rows: usize, num_groups: usize)
fn update_state(&mut self, input_rows: usize, num_groups: usize)
Updates SkipAggregationProbe state:
- increments the number of input rows
- replaces the number of groups with the new value
- on
probe_rows_thresholdexceeded calculates aggregation ratio and setsshould_skipflag - if
should_skipis set, locks further state updates
fn should_skip(&self) -> bool
Sourcefn record_skipped(&mut self, batch: &RecordBatch)
fn record_skipped(&mut self, batch: &RecordBatch)
Record the number of rows that were output directly without aggregation
Auto Trait Implementations§
impl Freeze for SkipAggregationProbe
impl RefUnwindSafe for SkipAggregationProbe
impl Send for SkipAggregationProbe
impl Sync for SkipAggregationProbe
impl Unpin for SkipAggregationProbe
impl UnwindSafe for SkipAggregationProbe
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