Enum mz_compute_client::plan::reduce::ReducePlan
source · pub enum ReducePlan {
Distinct,
DistinctNegated,
Accumulable(AccumulablePlan),
Hierarchical(HierarchicalPlan),
Basic(BasicPlan),
Collation(CollationPlan),
}
Expand description
A ReducePlan
provides a concise description for how we will
execute a given reduce expression.
The provided reduce expression can have no
aggregations, in which case its just a Distinct
and otherwise
it’s composed of a combination of accumulable, hierarchical and
basic aggregations.
We want to try to centralize as much decision making about the shape / general computation of the rendered dataflow graph in this plan, and then make actually rendering the graph be as simple (and compiler verifiable) as possible.
Variants§
Distinct
Plan for not computing any aggregations, just determining the set of distinct keys.
DistinctNegated
Plan for not computing any aggregations, just determining the set of distinct keys. A specialization of ReducePlan::Distinct maintaining rows not in the output.
Accumulable(AccumulablePlan)
Plan for computing only accumulable aggregations.
Hierarchical(HierarchicalPlan)
Plan for computing only hierarchical aggregations.
Basic(BasicPlan)
Plan for computing only basic aggregations.
Collation(CollationPlan)
Plan for computing a mix of different kinds of aggregations. We need to do extra work here to reassemble results back in the requested order.
Implementations§
source§impl ReducePlan
impl ReducePlan
sourcepub fn create_from(
aggregates: Vec<AggregateExpr>,
monotonic: bool,
expected_group_size: Option<usize>
) -> Self
pub fn create_from(
aggregates: Vec<AggregateExpr>,
monotonic: bool,
expected_group_size: Option<usize>
) -> Self
Generate a plan for computing the supplied aggregations.
The resulting plan summarizes what the dataflow to be created and how the aggregations will be executed.
sourcefn create_inner(
typ: ReductionType,
aggregates_list: Vec<(usize, AggregateExpr)>,
monotonic: bool,
expected_group_size: Option<usize>
) -> Self
fn create_inner(
typ: ReductionType,
aggregates_list: Vec<(usize, AggregateExpr)>,
monotonic: bool,
expected_group_size: Option<usize>
) -> Self
Generate a plan for computing the specified type of aggregations.
This function assumes that all of the supplied aggregates are actually of the correct reduction type, and are a subsequence of the total list of requested aggregations.
sourcepub fn keys(&self, key_arity: usize, arity: usize) -> AvailableCollections
pub fn keys(&self, key_arity: usize, arity: usize) -> AvailableCollections
Reports all keys of produced arrangements.
This is likely either an empty vector, for no arrangement, or a singleton vector containing the list of expressions that key a single arrangement.
Trait Implementations§
source§impl Arbitrary for ReducePlan
impl Arbitrary for ReducePlan
To avoid stack overflow, this limits the arbitrarily-generated test
ReducePlan
s to involve at most 8 aggregations.
To have better coverage of realistic expected group sizes, the
expected group size
has a logarithmic distribution.
§type Parameters = ()
type Parameters = ()
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.§type Strategy = BoxedStrategy<ReducePlan>
type Strategy = BoxedStrategy<ReducePlan>
Strategy
used to generate values of type Self
.source§fn arbitrary_with(_: Self::Parameters) -> Self::Strategy
fn arbitrary_with(_: Self::Parameters) -> Self::Strategy
source§impl Clone for ReducePlan
impl Clone for ReducePlan
source§fn clone(&self) -> ReducePlan
fn clone(&self) -> ReducePlan
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ReducePlan
impl Debug for ReducePlan
source§impl<'de> Deserialize<'de> for ReducePlan
impl<'de> Deserialize<'de> for ReducePlan
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq<ReducePlan> for ReducePlan
impl PartialEq<ReducePlan> for ReducePlan
source§fn eq(&self, other: &ReducePlan) -> bool
fn eq(&self, other: &ReducePlan) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl RustType<ProtoReducePlan> for ReducePlan
impl RustType<ProtoReducePlan> for ReducePlan
source§fn into_proto(&self) -> ProtoReducePlan
fn into_proto(&self) -> ProtoReducePlan
Self
into a Proto
value.source§fn from_proto(proto: ProtoReducePlan) -> Result<Self, TryFromProtoError>
fn from_proto(proto: ProtoReducePlan) -> Result<Self, TryFromProtoError>
source§impl Serialize for ReducePlan
impl Serialize for ReducePlan
impl Eq for ReducePlan
impl StructuralEq for ReducePlan
impl StructuralPartialEq for ReducePlan
Auto Trait Implementations§
impl RefUnwindSafe for ReducePlan
impl Send for ReducePlan
impl Sync for ReducePlan
impl Unpin for ReducePlan
impl UnwindSafe for ReducePlan
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
RustType::from_proto
.source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
RustType::into_proto
.