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

aggregate sum on Counter type of Cassandra

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Normal
    • Resolution: Duplicate
    • None
    • None
    • None

    Description

      I'm using Cassandra 2.2.0, and I've read "using Counter type".

      Is there a way to aggregate on Counter type column for Cassandra, similar to the following?

      SELECT sum(my_counter_column) FROM my_table ;

      The above query results in this error:

      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)"
      

      I know I can fetch all data and then do aggregation in the client, but I'm just wondering if it can be done within Cassandra. Thanks a lot.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              iamshrek Xin Ren
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: