Set intersection
Monday, March 07, 2011
2:45 PM
Set intersection
If we have s1:{thing:chararray} and s2:{thing:chararray}
then we can form their intersection via COGROUP and FILTER
Example: 
grps = COGROUP s1 BY thing, s2 BY thing;
grp2 = FILTER grps by IsEmpty(s1) OR IsEmpty(s2);
inter = FOREACH grp2 GENERATE group as thing;   