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

Sylvain Lebresne commented on CASSANDRA-4914:
---------------------------------------------

{quote}
The interface will be:
{noformat}
ResultSet IFilter(ResultSet rs, String... args)
{noformat}
{quote}

I think in practice this will have to be a bit more complicated. First, because 
I'm not sure aggregation makes much sense without GROUP BY. And if you have a 
group by, they the function need to be aware of what you are grouping on. Also, 
if function takes the whole ResultSet as input, this won't work if we want to 
do the work a bit incrementally (by paging for instance), so we might want to 
take that into account.

Also, we recently added some function support to the CQL3 code. It only handle 
function that basically apply to 1 CQL3 row (versus aggregating multiple ones), 
and it's not publicly exposed, but it's fairly generic otherwise. I suggest 
having a look on how this work, as it'd be nice if we could end with something 
not too dissimilar for this issue (typically the existing function interface 
expose type information, which I think we'll want here too (CQL3 is a typed 
language)).

Lastly, not sure what those 'String... args' are?

                
> Aggregate functions in CQL
> --------------------------
>
>                 Key: CASSANDRA-4914
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4914
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Vijay
>            Assignee: Vijay
>             Fix For: 2.0
>
>
> The requirement is to do aggregation of data in Cassandra (Wide row of column 
> values of int, double, float etc).
> With some basic agree gate functions like AVG, SUM, Mean, Min, Max, etc (for 
> the columns within a row).
> Example:
> SELECT * FROM emp WHERE empID IN (130) ORDER BY deptID DESC;                  
>                   
>  empid | deptid | first_name | last_name | salary
> -------+--------+------------+-----------+--------
>    130 |      3 |     joe    |     doe   |   10.1
>    130 |      2 |     joe    |     doe   |    100
>    130 |      1 |     joe    |     doe   |  1e+03
>  
> SELECT sum(salary), empid FROM emp WHERE empID IN (130);                      
>               
>  sum(salary) | empid
> -------------+--------
>    1110.1    |  130

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to