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 Plain View
Pig >> mail # user >> Group by with count


+
abhishek 2012-12-26, 19:06
+
Jonathan Coveney 2012-12-27, 19:31
+
Russell Jurney 2012-12-27, 20:14
Copy link to this message
-
Re: Group by with count
Thanks for the reply.

Sent from my iPhone

On Dec 27, 2012, at 3:14 PM, Russell Jurney <[EMAIL PROTECTED]> wrote:

> Shortened:
>
> b = foreach (group a by (col1, col2, col3)) generate FLATTEN(group),
> COUNT_STAR(a);
> On Dec 27, 2012 11:31 AM, "Jonathan Coveney" <[EMAIL PROTECTED]> wrote:
>
>> a = load 'tab1' as (col1, col2, col3);
>> b = group a by (col1, col2, col3);
>> c = foreach b generate FLATTEN(group), COUNT_STAR(a);
>>
>>
>> 2012/12/26 abhishek <[EMAIL PROTECTED]>
>>
>>> Hi all,
>>>
>>> How can I achieve above hive query in pig
>>>
>>> Create table x as select y.col1,y.col2,y.col3,count(*) as count from tab1
>>> y group by y.col1,y.col2,y.col3
>>>
>>> Regards
>>> Abhishek
>>
+
abhishek 2012-12-27, 20:36
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