Trait differential_dataflow::operators::group::GroupArranged
[−]
[src]
pub trait GroupArranged<G: Scope, K: Data, V: Data, R: Diff> where
G::Timestamp: Lattice + Ord, { fn group_arranged<L, V2, T2, R2>(
&self,
logic: L,
empty: T2
) -> Arranged<G, K, V2, R2, TraceAgent<K, V2, G::Timestamp, R2, T2>>
where
V2: Data,
R2: Diff,
T2: Trace<K, V2, G::Timestamp, R2> + 'static,
T2::Batch: Batch<K, V2, G::Timestamp, R2>,
L: Fn(&K, &[(&V, R)], &mut Vec<(V2, R2)>) + 'static; }
Extension trait for the group_arranged
differential dataflow method.
Required Methods
fn group_arranged<L, V2, T2, R2>(
&self,
logic: L,
empty: T2
) -> Arranged<G, K, V2, R2, TraceAgent<K, V2, G::Timestamp, R2, T2>> where
V2: Data,
R2: Diff,
T2: Trace<K, V2, G::Timestamp, R2> + 'static,
T2::Batch: Batch<K, V2, G::Timestamp, R2>,
L: Fn(&K, &[(&V, R)], &mut Vec<(V2, R2)>) + 'static,
&self,
logic: L,
empty: T2
) -> Arranged<G, K, V2, R2, TraceAgent<K, V2, G::Timestamp, R2, T2>> where
V2: Data,
R2: Diff,
T2: Trace<K, V2, G::Timestamp, R2> + 'static,
T2::Batch: Batch<K, V2, G::Timestamp, R2>,
L: Fn(&K, &[(&V, R)], &mut Vec<(V2, R2)>) + 'static,
Applies group
to arranged data, and returns an arrangement of output data.
This method is used by the more ergonomic group
, distinct
, and count
methods, although
it can be very useful if one needs to manually attach and re-use existing arranged collections.
Examples
extern crate timely; extern crate differential_dataflow; use differential_dataflow::input::Input; use differential_dataflow::operators::arrange::Arrange; use differential_dataflow::operators::group::GroupArranged; use differential_dataflow::trace::Trace; use differential_dataflow::trace::implementations::ord::OrdValSpine; use differential_dataflow::hashable::OrdWrapper; fn main() { ::timely::example(|scope| { // wrap and order input, then group manually. scope.new_collection_from(1 .. 10u32).1 .map(|x| (OrdWrapper { item: x / 3 }, x)) .arrange(OrdValSpine::new()) .group_arranged( move |_key, src, dst| dst.push((*src[0].0, 1)), OrdValSpine::new() ); }); }
Implementors
impl<G, K, V, R> GroupArranged<G, K, V, R> for Collection<G, (K, V), R> where
G: Scope,
G::Timestamp: Lattice + Ord,
K: Data + Hashable,
V: Data,
R: Diff,impl<G: Scope, K: Data, V: Data, T1, R: Diff> GroupArranged<G, K, V, R> for Arranged<G, K, V, R, T1> where
G::Timestamp: Lattice + Ord,
T1: TraceReader<K, V, G::Timestamp, R> + Clone + 'static,
T1::Batch: BatchReader<K, V, G::Timestamp, R>,