In the input file are the 2 sets of integers tab separated? The default
delimiter is tab in PigStorage and it seems the input file might not be
properly formatted?

Regards,
Shahab


On Sun, Aug 4, 2013 at 6:37 AM, sumit piparsania
<[email protected]>wrote:

> Hi,
>
> I am trying to process the following dataset using PIG using the commands
> below but i am not getting the desired output. The command is not able to
> parse the file as expected. Kindly help me in resolving this issue.
>
> Dataset in file called 'data'
>
> (3,8,9) (4,5,6)
> (1,4,7) (3,7,5)
> (2,5,8) (9,5,8)
>
> commands executed in grunt shell
> Actual Output:
> A = LOAD 'data' AS (t1:tuple(t1a:int,
> t1b:int,t1c:int),t2:tuple(t2a:int,t2b:int,t2c:int));
> DUMP A;
> ((3,8,9),,,)
> ((1,4,7),,,))
> ((2,5,8),,,))
>
> Expected Output:
> A = LOAD 'data' AS (t1:tuple(t1a:int,
> t1b:int,t1c:int),t2:tuple(t2a:int,t2b:int,t2c:int));
> DUMP A;
> ((3,8,9),(4,5,6))
> ((1,4,7),(3,7,5))
> ((2,5,8),(9,5,8))
> X = FOREACH A GENERATE t1.t1a,t2.$0;
> DUMP X;
> (3,4)
> (1,3)
> (2,9)

Reply via email to