Hi,
a = load 'input.txt' using PigStorage(',') as (id:int,list:chararray);
b = foreach a generate id, FLATTEN(TOKENIZE(list,'\\n'));
This returns what you want:
(1,a)
(1,b)
(2,a)
(2,c)
Thanks,
Cheolsoo
On Tue, Sep 25, 2012 at 3:47 PM, Mohit Anchlia <[email protected]>wrote:
> I have a input files that I need to split into multiple rows but with the
> same key. For example:
>
> 1,a\nb\n
> 2,a\nc\n
>
> After the split this looks like:
>
> 1,a
> 1,b
> 2,a
> 2,c
>
> Is this possible without writing an exec method?
>