apache pig - Pig one row to multiple row -


can please provide pig script below query?

here's input format. input

id, label   122,a|b 215,q|b|c 214,z|b|c 218,w|b|c 211,r|b|c 219,u|b 

expected output

122,a     122,b 215,q 215,b 215,c 214,z 214,b 214,c 218,w 218,b 218,c  ........... 

thanks,

abhi

tokenize label, give bag , flatten it, give many rows tuples in bag. sample code

inpt = load '....' using pigstorage(',') (id: chararray, label : chararray); result = foreach inpt generate id, flatten(tokenize(lable, '|'));  dump result; 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -