minion
minion

Reputation: 560

PIG: Read a bag and emit individual tuples

I have the following bag of data:

({(key1,value1),(key1,value2)}) ({(key2,value1),(key2,value1)})

The above data is stored in a file/relation & it has two rows of data where each row is a bag.

Is there a way of reading each bag emitting every tuple out of the bag?

Ex: Here I would like to emit (key1,value1) (key1,value2) (key2,value1) (key2,value2)

Please help. PIG is driving me crazy :( :(

Upvotes: 0

Views: 191

Answers (1)

LiMuBei
LiMuBei

Reputation: 3078

FLATTEN() should do the trick :) http://pig.apache.org/docs/r0.12.1/basic.html#flatten

Upvotes: 1

Related Questions