Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig >> mail # user >> add a key value pair in map


Copy link to this message
-
Re: add a key value pair in map
I don't think there's an out of the box solution for it. But it's fairly
trivial to do with a UDF
On Nov 15, 2013 3:19 PM, "Jerry Lam" <[EMAIL PROTECTED]> wrote:

> Hi Pig users,
>
> Do you know how to add a key value pair into a map?
>
> For instance, a relation of A contains a document:map[] for each tuple;
>
> B = foreach A generate document, ['newkey'#'newvalue'];
>
> I want to add the 'newkey' and 'newvalue' inside the document map. Is it
> possible?
>
> Best Regards,
>
> Jerry
>