Trait differential_dataflow::operators::group::Distinct
[−]
[src]
pub trait Distinct<G: Scope, K: Data> where
G::Timestamp: Lattice + Ord, { fn distinct(&self) -> Collection<G, K, isize>; fn distinct_u(&self) -> Collection<G, K, isize>
where
K: Unsigned + Copy; }
Extension trait for the distinct
differential dataflow method.
Required Methods
fn distinct(&self) -> Collection<G, K, isize>
Reduces the collection to one occurrence of each distinct element.
Examples
extern crate timely; extern crate differential_dataflow; use differential_dataflow::input::Input; use differential_dataflow::operators::Distinct; fn main() { ::timely::example(|scope| { // report at most one of each key. scope.new_collection_from(1 .. 10).1 .map(|x| x / 3) .distinct(); }); }
fn distinct_u(&self) -> Collection<G, K, isize> where
K: Unsigned + Copy,
K: Unsigned + Copy,
Reduces the collection to one occurrence of each distinct element.
This method is a specialization for when the key is an unsigned integer fit for distributing the data.
Examples
extern crate timely; extern crate differential_dataflow; use differential_dataflow::input::Input; use differential_dataflow::operators::Distinct; fn main() { ::timely::example(|scope| { // report at most one of each key. scope.new_collection_from(1 .. 10u32).1 .map(|x| x / 3) .distinct_u(); }); }