Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig >> mail # user >> Please help with grouped count


Copy link to this message
-
Please help with grouped count
We have logs in the following format

us, foo
us, foo
fr, fizz
us, bar
fr, baz
fr, fizz
us, foo
fr, fizz

Where the first column is a country and the second column is a search term.

How in the world can I output the country followed by the top terms in
order of occurrence... ie:

us, (foo, bar)      # Top term for 'us' is foo then bar then ...
fr, (fizz, baz)      # Top term for 'fr' is fizz then baz then ...

Thanks
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB