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

Switch to Plain View
Pig, mail # user - How can I generate a Map from a Tuple or a Bag


+
石瑞红 2011-09-08, 03:08
Copy link to this message
-
Re: How can I generate a Map from a Tuple or a Bag
Norbert Burger 2011-09-08, 11:58
Hi Ruihong -- if you can coalesce your data into (key1, value1, key2,
value2, key3, value3...) format, then you can use the TOMAP built-in
function:

https://issues.apache.org/jira/browse/PIG-1809

If you have more complex conversion requirements, then you can pass
the data off to a UDF which returns back a map.

Norbert

2011/9/7 石瑞红 <[EMAIL PROTECTED]>:
>
> HI all,
>
> How can I generate a Map from a Tuple or a Bag?
> I am looking for an example.
>
> Ruihong
>
+
jiang licht 2011-09-08, 20:28