Re: hive query to calculate percentage

2014-02-26 Thread Manish
p by timestamp_dt ) b on (a.timestamp_dt = b.timestamp_dt) 2) If you are using hive 11 or above, using windows functions. Yong Date: Tue, 25 Feb 2014 18:27:34 -0600 Subject: Re: hive query to calculate percentage From: kkrishna...@gm

RE: hive query to calculate percentage

2014-02-25 Thread java8964
estamp_dt) b on (a.timestamp_dt = b.timestamp_dt) 2) If you are using hive 11 or above, using windows functions. Yong Date: Tue, 25 Feb 2014 18:27:34 -0600 Subject: Re: hive query to calculate percentage From: kkrishna...@gmail.com To: user@hive.apache.org Modfiy the query to :select totalcount / sum(t

Re: hive query to calculate percentage

2014-02-25 Thread Krishnan K
Modfiy the query to : select totalcount / sum(totalcount) from daily_count_per_kg_domain where timestamp_dt = '20140219' group by timestamp_dt; if you dont specify the where clause, you will get result for all partitions. On Tue, Feb 25, 2014 at 3:14 PM, Manish wrote: > I have a partitioned ta

hive query to calculate percentage

2014-02-25 Thread Manish
I have a partitioned table on timestamp_dt: > desc daily_count_per_kg_domain; OK ddnamesyskg string totalcount int timestamp_dtstring hive> select * from daily_count_per_kg_domain; OK sys_kg_band 224 20140219 sys_kg_event343520140219 sys_kg_movies 44987 20140219