What's the error you are seeing? What does you bag of maps look like? What
exactly is a userId? Is it a field or is it a key in the map?


On Mon, Jun 17, 2013 at 8:18 PM, Jerry Lam <[email protected]> wrote:

> Hi Pig users,
>
> anyone has experience in dereferencing a bag of maps? For instance (in the
> example below), doc in the B contains maps of userId and time. I want to
> keep only userId in C. Pig throws an exception on C. Any help is
> appreciated.
>
> A = LOAD 'data' AS doc:bytearray;
>
> B = FOREACH A GENERATE (bag{})doc;
>
> -- C = FOREACH B GENERATE doc.userId; // this doesn't work.
>
> Best Regards,
>
> Jerry
>

Reply via email to