Variable.fromAntiJoin

Adds tuples from input1 whose key is not present in input2.

Examples

This example starts a collection with the pairs (x, x+1) for x in 0 .. 10. It then adds any pairs (x+1,x) for which x is not a multiple of three. That excludes four pairs (for 0, 3, 6, and 9) which should leave us with 16 total pairs.

use datafrog::{Iteration, Relation};

let mut iteration = Iteration::new();
let variable = iteration.variable::<(usize, usize)>("source");
variable.insert(Relation::from((0 .. 10).map(|x| (x, x + 1))));

let relation = Relation::from((0 .. 10).filter(|x| x % 3 == 0));

while iteration.changed() {
    variable.from_antijoin(&variable, &relation, |&key, &val| (val, key));
}

let result = variable.complete();
assert_eq!(result.len(), 16);
class Variable(TupleT)
void
fromAntiJoin
(
alias Fn
Input1T
Input2T
)
(
Input1T input1
,
Input2T input2
)
if (
isTuple!TupleT
)

Meta