I want to convert fields to rows in Pig.
from input.txt
1 2 3 4 5 6 7 8 9
delimeter between fields is '\t'.
to output.txt
1 2 3 4 ... but I must not use TOKENIZER because the content of fields might be a sentence. Please help me. Many Thanks.
I think alexeipab's answer is the right direction. Here is a simple example:
> A = load 'input.txt';
> dump A
(0,1,2,3,4,5,6,7,8,9)
> B = foreach A generate FLATTEN(TOBAG(*));
> dump B
(0)
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With