Trait mz_compute::extensions::reduce::ReduceExt
source · pub trait ReduceExt<G: Scope, Tr: TraceReader<Time = G::Timestamp>>{
// Required method
fn reduce_pair<L1, K, V1, T1, L2, V2, T2>(
&self,
name1: &str,
name2: &str,
logic1: L1,
logic2: L2,
) -> (Arranged<G, TraceAgent<T1>>, Arranged<G, TraceAgent<T2>>)
where K: Data,
T1: Trace + for<'a> TraceReader<Key<'a> = Tr::Key<'a>, Time = G::Timestamp> + 'static,
for<'a> T1::Key<'a>: IntoOwned<'a, Owned = K>,
for<'a> T1::Val<'a>: IntoOwned<'a, Owned = V1>,
T1::Diff: Abelian,
T1::Batch: Batch,
T1::Builder: Builder,
<T1::Builder as Builder>::Input: Container + PushInto<((K, V1), T1::Time, T1::Diff)>,
L1: FnMut(Tr::Key<'_>, &[(Tr::Val<'_>, Tr::Diff)], &mut Vec<(V1, T1::Diff)>) + 'static,
V1: Data,
T2: Trace + for<'a> TraceReader<Key<'a> = Tr::Key<'a>, Time = G::Timestamp> + 'static,
for<'a, 'a> T2::Val<'a>: IntoOwned<'a, Owned = V2>,
T2::Diff: Abelian,
T2::Batch: Batch,
T2::Builder: Builder,
<T2::Builder as Builder>::Input: Container + PushInto<((K, V2), T2::Time, T2::Diff)>,
L2: FnMut(Tr::Key<'_>, &[(Tr::Val<'_>, Tr::Diff)], &mut Vec<(V2, T2::Diff)>) + 'static,
V2: Data,
Arranged<G, TraceAgent<T1>>: ArrangementSize,
Arranged<G, TraceAgent<T2>>: ArrangementSize;
}
Expand description
Extension trait for ReduceCore
, currently providing a reduction based
on an operator-pair approach.
Required Methods§
sourcefn reduce_pair<L1, K, V1, T1, L2, V2, T2>(
&self,
name1: &str,
name2: &str,
logic1: L1,
logic2: L2,
) -> (Arranged<G, TraceAgent<T1>>, Arranged<G, TraceAgent<T2>>)where
K: Data,
T1: Trace + for<'a> TraceReader<Key<'a> = Tr::Key<'a>, Time = G::Timestamp> + 'static,
for<'a> T1::Key<'a>: IntoOwned<'a, Owned = K>,
for<'a> T1::Val<'a>: IntoOwned<'a, Owned = V1>,
T1::Diff: Abelian,
T1::Batch: Batch,
T1::Builder: Builder,
<T1::Builder as Builder>::Input: Container + PushInto<((K, V1), T1::Time, T1::Diff)>,
L1: FnMut(Tr::Key<'_>, &[(Tr::Val<'_>, Tr::Diff)], &mut Vec<(V1, T1::Diff)>) + 'static,
V1: Data,
T2: Trace + for<'a> TraceReader<Key<'a> = Tr::Key<'a>, Time = G::Timestamp> + 'static,
for<'a, 'a> T2::Val<'a>: IntoOwned<'a, Owned = V2>,
T2::Diff: Abelian,
T2::Batch: Batch,
T2::Builder: Builder,
<T2::Builder as Builder>::Input: Container + PushInto<((K, V2), T2::Time, T2::Diff)>,
L2: FnMut(Tr::Key<'_>, &[(Tr::Val<'_>, Tr::Diff)], &mut Vec<(V2, T2::Diff)>) + 'static,
V2: Data,
Arranged<G, TraceAgent<T1>>: ArrangementSize,
Arranged<G, TraceAgent<T2>>: ArrangementSize,
fn reduce_pair<L1, K, V1, T1, L2, V2, T2>(
&self,
name1: &str,
name2: &str,
logic1: L1,
logic2: L2,
) -> (Arranged<G, TraceAgent<T1>>, Arranged<G, TraceAgent<T2>>)where
K: Data,
T1: Trace + for<'a> TraceReader<Key<'a> = Tr::Key<'a>, Time = G::Timestamp> + 'static,
for<'a> T1::Key<'a>: IntoOwned<'a, Owned = K>,
for<'a> T1::Val<'a>: IntoOwned<'a, Owned = V1>,
T1::Diff: Abelian,
T1::Batch: Batch,
T1::Builder: Builder,
<T1::Builder as Builder>::Input: Container + PushInto<((K, V1), T1::Time, T1::Diff)>,
L1: FnMut(Tr::Key<'_>, &[(Tr::Val<'_>, Tr::Diff)], &mut Vec<(V1, T1::Diff)>) + 'static,
V1: Data,
T2: Trace + for<'a> TraceReader<Key<'a> = Tr::Key<'a>, Time = G::Timestamp> + 'static,
for<'a, 'a> T2::Val<'a>: IntoOwned<'a, Owned = V2>,
T2::Diff: Abelian,
T2::Batch: Batch,
T2::Builder: Builder,
<T2::Builder as Builder>::Input: Container + PushInto<((K, V2), T2::Time, T2::Diff)>,
L2: FnMut(Tr::Key<'_>, &[(Tr::Val<'_>, Tr::Diff)], &mut Vec<(V2, T2::Diff)>) + 'static,
V2: Data,
Arranged<G, TraceAgent<T1>>: ArrangementSize,
Arranged<G, TraceAgent<T2>>: ArrangementSize,
This method produces a reduction pair based on the same input arrangement. Each reduction in the pair operates with its own logic and the two output arrangements from the reductions are produced as a result. The method is useful for reductions that need to present different output views on the same input data. An example is producing an error-free reduction output along with a separate error output indicating when the error-free output is valid.
Object Safety§
This trait is not object safe.