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

Switch to Threaded View
Pig >> mail # user >> how to operate a map type

Copy link to this message
how to operate a map type
Hi all,

I have the below pig code:

register /home/uu/project/lib/pigudfs.jar
ruls = load 'testurl' as (url:chararray);

b = foreach ruls generate com.company.pig.GetURLContent($0,3,0.1);

here when dump b, it will return:

I just want group by the map key and sum the map value just like:
c = group b by $0#key;
d = foreach c generate group,SUM(b.$0#value);

How could I write the code?

Jameson Li.