Hi Jerry, I would recommend to debug the issue step by step. Just after this line: A = load 'data.txt' as document:[]; and then right after that: DESCRIBE A; DUMP A; and so on...
To be honest I haven't used maps that much. Just curious, why did you choose to use them? You can also use regular tuples for storing the relations. Also you can store the tuples with a schema file. Ruslan On Wed, Apr 17, 2013 at 5:28 AM, Jerry Lam <[email protected]> wrote: > Hi pig users, > > I tried to load data using PigStorage that was previously stored using > PigStorage but it failed. > > Each line looks like this in the data file that is generated by PigStorage: > [a#hello,b#{([c#11,d#22]),([c#33,d#44])}] > > I did the following: > A = load 'data.txt' as document:[]; > B = foreach A generate document#'b' as b; > C = foreach B generate flatten(b); > dump C; > > I expect to see the following output: > ([c#11,d#22]) > ([c#33,d#44]) > > Instead, I got: > java.lang.ClassCastException: org.apache.pig.data.DataByteArray cannot be > cast to org.apache.pig.data.DataBag > > Anyone encounters this problem before? How can I read the data back? > > Thanks, > > Jerry >
