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
Hive >> mail # user >> Built - In Aggregate Function - Standard Deviation


+
Matt Pestritto 2009-05-26, 20:02
Copy link to this message
-
Re: Built - In Aggregate Function - Standard Deviation
I agree that a builtin for std dev is a good idea.

that said, you can achieve this easy in one pass, just use:

select sum( pow(col,2) ) as totsqr, sum( col ) as tot, count(1) as n,
pow( (n*totsqr - pow(tot,2) )/(n*(n-1)), 0.5) as stddev
from ....

Matt Pestritto wrote:
> Hi.
>
> Are there plans to write a standard deviation aggregate function ?  I
> had to build my own which translated into multiple hive queries.  
> While it works, a build-in function would have been much easier.
>
> Thanks
> -Matt
+
Matt Pestritto 2009-05-30, 23:08
+
Zheng Shao 2009-05-30, 23:22
+
Amr Awadallah 2009-05-31, 07:04
+
Zheng Shao 2009-05-31, 09:35
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