Trait differential_dataflow::operators::group::Group [] [src]

pub trait Group<G: Scope, K: Data, V: Data> where
    G::Timestamp: Lattice
{ fn group<L, V2: Data>(&self, logic: L) -> Collection<G, (K, V2)>
    where
        L: Fn(&K, &mut CollectionIterator<DifferenceIterator<V>>, &mut Vec<(V2, Delta)>) + 'static
; fn group_u<L, V2: Data>(&self, logic: L) -> Collection<G, (K, V2)>
    where
        K: Unsigned + Default,
        L: Fn(&K, &mut CollectionIterator<DifferenceIterator<V>>, &mut Vec<(V2, i32)>) + 'static
; }

Extension trait for the group differential dataflow method

Required Methods

Groups records by their first field, and applies reduction logic to the associated values.

It would be nice for this to be generic over possible arrangements of data, but it seems that Rust ICEs when I try this. I'm not exactly sure how one would specify the arrangement (the type is used in logic, by way of its associated iterator types, but not clearly enough to drive type inference), but we don't have that problem yet anyhow.

In any case, it would be great if the same implementation could handle (K,V) pairs and K elements treated as (K, ()) pairs.

Groups records by their first field, when this field implements Unsigned.

This method uses a Vec<Option<_>> as its internal storage, allocating enough memory to directly index based on the first fields. This can be very useful when these fields are small integers, but it can be expensive if they are large and sparse.

Implementors