-Re: Built - In Aggregate Function - Standard Deviation
Amr Awadallah 2009-05-27, 08:24
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
Matt Pestritto wrote:
> 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.