Pig Query Doubt

20 views
Skip to first unread message

Sivaji

unread,
Aug 18, 2014, 3:14:11 PM8/18/14
to chenn...@googlegroups.com
Hi i am struck ed in PIG query can please help me any one below are reuirement

two bags 

 BagA
(101,Hari)
(102,Nani)
(105,Siva)

BagB
(102,Nani)
(106,Ram)

expected out 1: BagA-BagB
                       (101,Hari)
                      (105,Siva)

expected out 1: BagA-BagB
                       (101,Hari)
                      (105,Siva)
                      (106,Ram)
can you please any one help me how we are going to do this Prob ?

Vallinayagam

unread,
Aug 19, 2014, 2:49:44 AM8/19/14
to chenn...@googlegroups.com
Hello,

For your first query SUBTRACT function will do the job, which returns a new Bag composed of tuples of BagA are not in the BagB.

For your second query DIFF function works well, which returns a new Bag composed of tuples of one Bag (BagA / BagB) but not in the other.

Note : Assuming both the Bags are fit into memory, If this is not the case performance degradation would happen.



--
You received this message because you are subscribed to the Google Groups "Hadoop Users Group (HUG) Chennai" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chennaihug+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Many Thanks,
S.Vallinayagam
Reply all
Reply to author
Forward
0 new messages