Hadoop Pig. Changing structure -
can me change structure of file?
for example:
i have string 2 delimiters:
1;2,3,4;2i want change raws 1 delimiter:
1;2;2 1;3;2 1;4;2
pig script :
= load 'a.csv' using pigstorage(';') (value1:chararray,value2:chararray,value3:chararray); b = foreach generate value1, flatten(tokenize(value2, ',')), value3; dump b; input :
1;2,3,4;2 output :
(1,2,2) (1,3,2) (1,4,2) we can store b using ; delimiter.
store b 'requiredoutputlocation' using pigstorage(';');
Comments
Post a Comment