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

Aggregate with Initial Condition fails with C* 3.0

    XMLWordPrintableJSON

Details

    • Normal

    Description

      I'm seeing some inconsistent behavior between 2.2 and 3.0 C* with regards to UDF, Aggregates and Initial Conditions. I have a scenario, which I think is valid. It works in C* 2.2 but not in 3.0

      Using the following user defined function

      CREATE OR REPLACE FUNCTION extend_list(s list<text>, i int)
                                        CALLED ON NULL INPUT
                                        RETURNS list<text>
                                        LANGUAGE java AS 'if (i != null) s.add(String.valueOf(i)); return s;';
      

      With the aggregate below

      CREATE AGGREGATE aggregatemetadata.test_init_cond_aggregate(int) SFUNC extend_list STYPE list<text> INITCOND [  ]
      

      When I attempt to exercise the aggregate on from a simple key value table.

      SELECT test_init_cond_aggregate(v) AS list_res FROM t
      

      in 2.2 it works fine and returns the aggregate.

      The exact same test ran against the 3.0 branch produces the following exception from the server.

      InvalidRequest: code=2200 [Invalid query] message="ERROR FUNCTION_FAILURE: execution of 'aggregatemetadata.extend_list[list<text>, int]' failed: java.lang.UnsupportedOperationException"
      

      I've grepped through the C* logs but I couldn't find a more verbose stack trace, or any errors.
      Robert Stupp suggested I open a ticket.

      I am able to reproduce both in the python driver manually using cql.

      Attachments

        Issue Links

          Activity

            People

              snazy Robert Stupp
              greg.bestland Greg Bestland
              Robert Stupp
              Sylvain Lebresne
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: