Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-9977

Support counter-columns for native aggregates (sum,avg,max,min)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 2.2.5, 3.0.3
    • Legacy/CQL
    • None

    Description

      When trying to SUM a column of type COUNTER, this error is returned:

      InvalidRequest: code=2200 [Invalid query] message="Invalid call to function sum, none of its type signatures match (known type signatures: system.sum : (tinyint) -> tinyint, system.sum : (smallint) -> smallint, system.sum : (int) -> int, system.sum : (bigint) -> bigint, system.sum : (float) -> float, system.sum : (double) -> double, system.sum : (decimal) -> decimal, system.sum : (varint) -> varint)"
      

      This might be relevant for other agg. functions.

      CQL for reproduction:

      CREATE TABLE test (
              key INT,
              ctr COUNTER,
              PRIMARY KEY (
                      key
              )
      );
      
      UPDATE test SET ctr = ctr + 1 WHERE key = 1;
      SELECT SUM(ctr) FROM test;
      

      Attachments

        Issue Links

          Activity

            People

              snazy Robert Stupp
              noliran Noam Liran
              Robert Stupp
              Benjamin Lerer
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: