Hadoop Pig. Changing structure -


can me change structure of file?

for example:

  1. i have string 2 delimiters:

    1;2,3,4;2 
  2. i 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

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -