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

Aggregation functions in CQL

    XMLWordPrintableJSON

Details

    Description

      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

      Attachments

        1. CASSANDRA-4914.txt
          55 kB
          Benjamin Lerer
        2. CASSANDRA-4914-V2.txt
          62 kB
          Benjamin Lerer
        3. CASSANDRA-4914-V3.txt
          79 kB
          Benjamin Lerer
        4. CASSANDRA-4914-V4.txt
          79 kB
          Benjamin Lerer
        5. CASSANDRA-4914-V5.txt
          79 kB
          Benjamin Lerer

        Issue Links

          Activity

            People

              blerer Benjamin Lerer
              vijay2win@yahoo.com Vijay
              Benjamin Lerer
              Sylvain Lebresne
              Shawn Kumar Shawn Kumar
              Votes:
              17 Vote for this issue
              Watchers:
              43 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: