You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Mohit Anchlia <mo...@gmail.com> on 2012/04/20 00:47:31 UTC

Ordering inside Bag

I have this output:


{(ST),(ZIP),(CITY),(NAM2)} {(NC),(28613),(Xxxxxxx),(Xxxxx X &xxx; Xxxxx X
Xxxxxx)}

{(NAM2),(ST),(ZIP),(CITY)} {(Xxxx X &xxx; Xxxxx X
Xxxxxx),(CO),(55555),(Xxxxxx)}

Above output is one to one logical mapping between 2 bags in the same row.
For eg: ST in one bag directly corresponds to NC in other bag. So this
means State = NC, ZIP = 28613

Is there a way to produce output in order ST,ZIP for instance. So in above
example final output would look like:

NC, 28613

CO, 55555