You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by "Khamgaonwala, Hussain" <Hu...@supervalu.com> on 2012/04/25 04:26:11 UTC

Question on Pig Script

Hello,

 

I am new to pig and I am trying to write pig script which will take the
following records as an input 

 

(48514619041_20044,{(1),(2),(3),(4)})

(48514619041_20045,{(5),(6)})

(48514619041_20044,{(7),(8),(9),(10),(11)})

(48542605038_20045,{(12),(13)})

 

 

And provide me following output

 

(48514619041_20044,{(1),(2),(3),(4),(7),(8),(9),(10),(11)})

(48514619041_20045,{(5),(6)})

(48542605038_20045,{(12),(13)})

 

To achieve the above I used this command 

GROUP FLATTENED_TABLE_REQ BY LOYALTY_NUM_TRANS_DT where
FLATTENED_TABLE_REQ = input data stored in table and
LOYALTY_NUM_TRANS_DT = first column of the table.

 

I get this as an output

 

(48514619041_20044,{(48514619041_20044,{(1),(2),(3),(4)}),(48514619041_2
0044,{(7),(8),(9),(10),(11)})})

(48514619041_20045,{(48514619041_20045,{(5),(6)})})

(48542605038_20045,{(48542605038_20045,{(12),(13)})})

 

 

 

How should I modify the above pig command to generate the output in the
required form above?

 

Need help in solving this

 

 

 

Regards,

Hussain K

Office  :  952 828 4157

Mobile:952 681 0208