[][src]Trait differential_dataflow::operators::join::JoinCore

pub trait JoinCore<G: Scope, K: 'static, V: 'static, R: Semigroup> where
    G::Timestamp: Lattice + Ord
{ fn join_core<Tr2, I, L>(
        &self,
        stream2: &Arranged<G, Tr2>,
        result: L
    ) -> Collection<G, I::Item, <R as Mul<Tr2::R>>::Output>
    where
        Tr2: TraceReader<Key = K, Time = G::Timestamp> + Clone + 'static,
        Tr2::Batch: BatchReader<K, Tr2::Val, G::Timestamp, Tr2::R> + 'static,
        Tr2::Cursor: Cursor<K, Tr2::Val, G::Timestamp, Tr2::R> + 'static,
        Tr2::Val: Ord + Clone + Debug + 'static,
        Tr2::R: Semigroup,
        R: Mul<Tr2::R>,
        <R as Mul<Tr2::R>>::Output: Semigroup,
        I: IntoIterator,
        I::Item: Data,
        L: FnMut(&K, &V, &Tr2::Val) -> I + 'static
; }

Matches the elements of two arranged traces.

This method is used by the various join implementations, but it can also be used directly in the event that one has a handle to an Arranged<G,T>, perhaps because the arrangement is available for re-use, or from the output of a group operator.

Required methods

fn join_core<Tr2, I, L>(
    &self,
    stream2: &Arranged<G, Tr2>,
    result: L
) -> Collection<G, I::Item, <R as Mul<Tr2::R>>::Output> where
    Tr2: TraceReader<Key = K, Time = G::Timestamp> + Clone + 'static,
    Tr2::Batch: BatchReader<K, Tr2::Val, G::Timestamp, Tr2::R> + 'static,
    Tr2::Cursor: Cursor<K, Tr2::Val, G::Timestamp, Tr2::R> + 'static,
    Tr2::Val: Ord + Clone + Debug + 'static,
    Tr2::R: Semigroup,
    R: Mul<Tr2::R>,
    <R as Mul<Tr2::R>>::Output: Semigroup,
    I: IntoIterator,
    I::Item: Data,
    L: FnMut(&K, &V, &Tr2::Val) -> I + 'static, 

Joins two arranged collections with the same key type.

Each matching pair of records (key, val1) and (key, val2) are subjected to the result function, which produces something implementing IntoIterator, where the output collection will have

This trait is implemented for arrangements (Arranged<G, T>) rather than collections. The Join trait contains the implementations for collections.

Examples

extern crate timely;
extern crate differential_dataflow;

use differential_dataflow::input::Input;
use differential_dataflow::operators::arrange::ArrangeByKey;
use differential_dataflow::operators::join::JoinCore;
use differential_dataflow::trace::Trace;
use differential_dataflow::trace::implementations::ord::OrdValSpine;
use differential_dataflow::hashable::OrdWrapper;

fn main() {
    ::timely::example(|scope| {

        let x = scope.new_collection_from(vec![(0u32, 1), (1, 3)]).1
                     .arrange_by_key();
        let y = scope.new_collection_from(vec![(0, 'a'), (1, 'b')]).1
                     .arrange_by_key();

        let z = scope.new_collection_from(vec![(1, 'a'), (3, 'b')]).1;

        x.join_core(&y, |_key, &a, &b| Some((a, b)))
         .assert_eq(&z);
    });
}
Loading content...

Implementors

impl<G, K, V, R> JoinCore<G, K, V, R> for Collection<G, (K, V), R> where
    G: Scope,
    K: ExchangeData + Hashable,
    V: ExchangeData,
    R: ExchangeData + Semigroup,
    G::Timestamp: Lattice + Ord
[src]

impl<G, T1> JoinCore<G, <T1 as TraceReader>::Key, <T1 as TraceReader>::Val, <T1 as TraceReader>::R> for Arranged<G, T1> where
    G: Scope,
    G::Timestamp: Lattice + Ord + Debug,
    T1: TraceReader<Time = G::Timestamp> + Clone + 'static,
    T1::Key: Ord + Debug + 'static,
    T1::Val: Ord + Clone + Debug + 'static,
    T1::R: Semigroup,
    T1::Batch: BatchReader<T1::Key, T1::Val, G::Timestamp, T1::R> + 'static,
    T1::Cursor: Cursor<T1::Key, T1::Val, G::Timestamp, T1::R> + 'static, 
[src]

Loading content...