I just tried this exact example and at the start it didn't work when I used the 'data' file as is how I copy and pasted it from the Pig Latin reference page and I was seeing similar issues to yours.
Then I simply edited the 'data' file but deleting the space between the 2 sets and adding a tab. Now it is working fine and I see the expected output as mentioned by you and the manual page. Have you tried manually editing the input file? How did you create it? Did you copy pasted it from somewhere? No harm in trying reinserting the tab between them. Regards, Shahab On Sun, Aug 4, 2013 at 12:28 PM, sumit piparsania <[email protected] > wrote: > hi Shahab, > > Yes, the 2 sets of integers are tab separated. Still getting the error. > What could be reason for this error. > > *From:* Shahab Yunus <[email protected]> > *To:* [email protected]; sumit piparsania <[email protected]> > *Sent:* Sunday, August 4, 2013 9:33 PM > *Subject:* Re: error in processing data in pig > > 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) > > > > >
