[
https://issues.apache.org/jira/browse/CASSANDRA-4914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14151074#comment-14151074
]
Robert Stupp commented on CASSANDRA-4914:
-----------------------------------------
bq. aggregate functions do only return their input type ...
Hm - I still think that we should be able to handle integer overflows - if for
example people get a negative result if summing just positive values, they'll
complain about it.
Postgres for example [returns a bigint for int
sums|http://www.postgresql.org/docs/9.1/static/functions-aggregate.html] -
Oracle doesn't have any integer data type in tables (only that NUMBER data
type).
(But if that input-type==output-type behavior is clearly documented and people
are able to do e.g. a {{SELECT sum( (varint) myIntCol ) FROM ...}} then that's
fine for me - but I'm not sold on this.)
> Aggregation functions in CQL
> ----------------------------
>
> Key: CASSANDRA-4914
> URL: https://issues.apache.org/jira/browse/CASSANDRA-4914
> Project: Cassandra
> Issue Type: New Feature
> Reporter: Vijay
> Assignee: Benjamin Lerer
> Labels: cql, docs
> Fix For: 3.0
>
> Attachments: CASSANDRA-4914-V2.txt, CASSANDRA-4914-V3.txt,
> CASSANDRA-4914-V4.txt, CASSANDRA-4914.txt
>
>
> 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 was sent by Atlassian JIRA
(v6.3.4#6332)