I have a table A which contains a list, a table B which contains a sub-list of the items in A. How should get a table C which contains a list which is the complement of B in A?
I know how to do it in sql. Am not sure how to approach it in Pig.
Thanks.
In PIG words, you have two “bags” A and B, where B is a subset of A.
If B only contains values in A, you can do C = DIFF(A,B).
However, consider that DIFF removes duplicates, so you will get the complement of B in A reduced to unique values.
Generally, DIFF provides the union of both the complement of B in A and that of A in B.