[
https://issues.apache.org/jira/browse/CASSANDRA-8053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14196983#comment-14196983
]
Robert Stupp commented on CASSANDRA-8053:
-----------------------------------------
Updated to a new branch (was easier) that uses syntax that references scalar
functions.
{code}
CREATE AGGREGATE <functionName>(<param-type...>)
SFUNC <name-of-scalar>
STYPE <type>
[ FINALFUNC <name-of-scalar>
[ FINALTYPE <type> ] ]
[ INITCOND <term> ]
{code}
Note: state and final functions are references without the keyspace (just by
their scalar-function-name).
UD aggregates use any scalar function that can be resolved via
{{Functions.find}} (not limited to user-defined scalar functions).
The first parameter of state and final functions is the state parameter.
Branch is currently missing some checks (e.g. check state-type against state
and final functions) but it works :)
> Support for user defined aggregate functions
> --------------------------------------------
>
> Key: CASSANDRA-8053
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8053
> Project: Cassandra
> Issue Type: New Feature
> Reporter: Robert Stupp
> Assignee: Robert Stupp
> Labels: cql, udf
> Fix For: 3.0
>
>
> CASSANDRA-4914 introduces aggregate functions.
> This ticket is about to decide how we can support "user defined aggregate
> functions". UD aggregate functions should be supported for all UDF flavors
> (class, java, jsr223).
> Things to consider:
> * Special implementations for each scripting language should be omitted
> * No exposure of internal APIs (e.g. {{AggregateFunction}} interface)
> * No need for users to deal with serializers / codecs
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)