pub enum AggregateMode {
Partial,
Final,
FinalPartitioned,
Single,
SinglePartitioned,
PartialReduce,
}Expand description
Aggregation modes
See Accumulator::state for background information on multi-phase
aggregation and how these modes are used.
§Variants and their input/output modes
Each variant can be characterized by its AggregateInputMode and
AggregateOutputMode:
| Input: Raw data | Input: Partial state
Output: Final values | Single, SinglePartitioned | Final, FinalPartitioned
Output: Partial state | Partial | PartialReduceUse AggregateMode::input_mode and AggregateMode::output_mode
to query these properties.
Variants§
Partial
One of multiple layers of aggregation, any input partitioning
Partial aggregate that can be applied in parallel across input partitions.
This is the first phase of a multi-phase aggregation.
Final
Final of multiple layers of aggregation, in exactly one partition
Final aggregate that produces a single partition of output by combining the output of multiple partial aggregates.
This is the second phase of a multi-phase aggregation.
This mode requires that the input is a single partition
Note: Adjacent Partial and Final mode aggregation is equivalent to a Single
mode aggregation node. The Final mode is required since this is used in an
intermediate step. The CombinePartialFinalAggregate physical optimizer rule
will replace this combination with Single mode for more efficient execution.
FinalPartitioned
Final of multiple layers of aggregation, input is Partitioned
Final aggregate that works on pre-partitioned data.
This mode requires that all rows with a particular grouping key are in the same partitions, such as is the case with Hash repartitioning on the group keys. If a group key is duplicated, duplicate groups would be produced
Single
Single layer of Aggregation, input is exactly one partition
Applies the entire logical aggregation operation in a single operator, as opposed to Partial / Final modes which apply the logical aggregation using two operators.
This mode requires that the input is a single partition (like Final)
SinglePartitioned
Single layer of Aggregation, input is Partitioned
Applies the entire logical aggregation operation in a single operator, as opposed to Partial / Final modes which apply the logical aggregation using two operators.
This mode requires that the input has more than one partition, and is partitioned by group key (like FinalPartitioned).
PartialReduce
Combine multiple partial aggregations to produce a new partial aggregation.
Input is intermediate accumulator state (like Final), but output is also intermediate accumulator state (like Partial). This enables tree-reduce aggregation strategies where partial results from multiple workers are combined in multiple stages before a final evaluation.
Final
/ \
PartialReduce PartialReduce
/ \ / \
Partial Partial Partial PartialImplementations§
Source§impl AggregateMode
impl AggregateMode
Sourcepub fn input_mode(&self) -> AggregateInputMode
pub fn input_mode(&self) -> AggregateInputMode
Returns the AggregateInputMode for this mode: whether this
stage consumes raw input data or intermediate accumulator state.
See the table above for details.
Sourcepub fn output_mode(&self) -> AggregateOutputMode
pub fn output_mode(&self) -> AggregateOutputMode
Returns the AggregateOutputMode for this mode: whether this
stage produces intermediate accumulator state or final output values.
See the table above for details.
Trait Implementations§
Source§impl Clone for AggregateMode
impl Clone for AggregateMode
Source§fn clone(&self) -> AggregateMode
fn clone(&self) -> AggregateMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AggregateMode
impl Debug for AggregateMode
Source§impl PartialEq for AggregateMode
impl PartialEq for AggregateMode
impl Copy for AggregateMode
impl Eq for AggregateMode
impl StructuralPartialEq for AggregateMode
Auto Trait Implementations§
impl Freeze for AggregateMode
impl RefUnwindSafe for AggregateMode
impl Send for AggregateMode
impl Sync for AggregateMode
impl Unpin for AggregateMode
impl UnsafeUnpin for AggregateMode
impl UnwindSafe for AggregateMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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