Joins
Wednesday, April 27, 2011
12:34 PM
A join is a filter for a product!
# simple join
out <= (r * s).pairs(:r.value => :s.key) do |t1, t2|
         [t1.key, t2.value]
end
Pasted from <[link]> 
(r*s).pairs(...condition...): do something for all pairs where the match condition is as specified. 
do...end: ruby for multi-line implicit map {…}
(:r.value => :s.key): a match condition for the pairs
(:r.value and :s.key are names).
# the above Bloom statements are equivalent to this SQL:
# SELECT r.key, s.value
#   FROM r, s
#  WHERE r.value = s.key;