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

Scott Lewis commented on DERBY-5466:
------------------------------------

Yes, they would be invoked via SQL.  For example

SELECT VAR_POP(value) FROM MYTABLE

where value is a column from MYTABLE.   The above would return the population 
variance of the value column.  The function VAR_POP is create via this 
statement (e.g.)

ij> CREATE DERBY AGGREGATE VAR_POP FOR DOUBLE RETURNS Double EXTERNAL NAME 
'org.apache.derby.functions.VarPAggregator';

WRT package name...I'm fine with anything that works appropriately.   There are 
a number of built-in functions (not user defined) in

org.apache.derby.impl.sql.execute   

which sort of implies that something like this might work for user-defined:

org.apache.derby.impl.sql.user.execute.statistics

but that might be too verbose for the Derby committers.   Or

org.apache.derby.impl.sql.user.execute

What do you think?





> Add support for SQL Standard statistics functions, such as STDDEV_POP, 
> STDDEV_SAMP, VAR_POP, VAR_SAMP
> -----------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5466
>                 URL: https://issues.apache.org/jira/browse/DERBY-5466
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.8.1.2
>            Reporter: Lukas Eder
>            Priority: Minor
>              Labels: derby_triage10_10
>
> Any of these RDBMS support the SQL standard statistics functions STDDEV_POP, 
> STDDEV_SAMP, VAR_POP, VAR_SAMP:
> - DB2 (only STDDEV, VARIANE)
> - H2 
> - HSQLDB 
> - Ingres 
> - MySQL 
> - Oracle 
> - Postgres 
> - SQL Server (named STDEVP, STDEV, VARP, VAR)
> - Sybase ASE
> - Sybase SQL Anywhere
> These don't:
> - Derby
> - SQLite
> This would be a useful addition for Derby, I think.
> An even larger example list of possible statistics aggregate functions is 
> listed in the Postgres documentation:
> http://www.postgresql.org/docs/9.0/static/functions-aggregate.html#FUNCTIONS-AGGREGATE-STATISTICS-TABLE



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to