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

Switch to Threaded View
Pig >> mail # user >> Group by with count


Copy link to this message
-
Re: Group by with count
Thanks for the reply , I got it

Sent from my iPhone

On Dec 27, 2012, at 2:31 PM, 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
>>