[ 
https://issues.apache.org/jira/browse/DRILL-202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13805925#comment-13805925
 ] 

Tommy Guy commented on DRILL-202:
---------------------------------

Hey guys, new here. Hope you don't mind the patch! 

The ticket description describes more than just the average and std. dev. 
functions mentioned in the title. I started with min b/c it and max are 
easiest. If you prefer, I can split these out into sub-tickets.

My plan is to 
1) Get a quick "right direction" check from someone with a little more 
experience
2) Implement max and DRY out sum/max/min
3) Start on avg, std dev, ect. 

> Implement average and standard deviation functions
> --------------------------------------------------
>
>                 Key: DRILL-202
>                 URL: https://issues.apache.org/jira/browse/DRILL-202
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: M2, Beta
>            Reporter: Ted Dunning
>              Labels: newbie
>
> I need several statistical functions including average.  To be complete, I 
> would like to implement several of the statistical functions from Postgres:
> {code}
> Function      Argument Type   Return Type     Description
> avg(expression)       smallint, int, bigint, real, double precision, numeric, 
> or interval     numeric for any integer-type argument, double precision for a 
> floating-point argument, otherwise the same as the argument data type     the 
> average (arithmetic mean) of all input values
> max(expression)       any array, numeric, string, or date/time type   same as 
> argument type   maximum value of expression across all input values
> min(expression)       any array, numeric, string, or date/time type   same as 
> argument type   minimum value of expression across all input values
> stddev(expression)    smallint, int, bigint, real, double precision, or 
> numeric       double precision for floating-point arguments, otherwise 
> numeric        historical alias for stddev_samp
> stddev_pop(expression)        smallint, int, bigint, real, double precision, 
> or numeric       double precision for floating-point arguments, otherwise 
> numeric        population standard deviation of the input values
> stddev_samp(expression)       smallint, int, bigint, real, double precision, 
> or numeric       double precision for floating-point arguments, otherwise 
> numeric        sample standard deviation of the input values
> variance(expression)  smallint, int, bigint, real, double precision, or 
> numeric       double precision for floating-point arguments, otherwise 
> numeric        historical alias for var_samp
> var_pop(expression)   smallint, int, bigint, real, double precision, or 
> numeric       double precision for floating-point arguments, otherwise 
> numeric        population variance of the input values (square of the 
> population standard deviation)
> var_samp(expression)  smallint, int, bigint, real, double precision, or 
> numeric       double precision for floating-point arguments, otherwise 
> numeric        sample variance of the input values (square of the sample 
> standard deviation)
> {code}
> I plan to put these in with sum.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to