cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alain RODRIGUEZ (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-2830) Allow summing of counter columns in CQL
Date Thu, 27 Jun 2013 10:09:21 GMT


Alain RODRIGUEZ commented on CASSANDRA-2830:

Is this now easier to do since we have CQL 3 ?

 cid | lid | date       | event | val
   1 |   1 | 2013061308 | start |   5
   2 |   1 | 2013061308 | start |   5

I would like to be allowed doing this kind of stuff : "select SUM(val) from stats_agency where
lid = 1 ALLOW FILTERING;" with an expected result of 10. This would be awesome and would take
advantage of composites on counter columns to allow having multidimensional statistics.

Is this doable ?

> Allow summing of counter columns in CQL
> ---------------------------------------
>                 Key: CASSANDRA-2830
>                 URL:
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Tomas Salfischberger
>            Priority: Minor
>              Labels: CQL
> CQL could be extended with a method to calculate the sum of a set of counter columns.
This avoids transferring a long list of counter columns to be summed by the client, while
the server could calculate the total and instead only transfer that result. My proposal for
the syntax (based on the COUNT() suggestion in the comments of CASSANDRA-1704):
> {code}SELECT SUM(<columnFrom>..<columnTo>) FROM <CF> WHERE ...{code}
> The simplest approach would be to only allow summing of counters under the same key,
thus a query with a WHERE part that specifies multiple keys would return 1 result per key.
This avoids summing values from different nodes.

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:

View raw message