You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by lowping <lo...@163.com> on 2016/06/27 08:03:52 UTC
UDA can't use int or text as state_type
Hi, all
I got a problem today when I create a UDA like this. hope you guys help me solve this
CREATE OR REPLACE FUNCTION sum_fun(state int, type text) // if state type is SET or MAP , this is work
CALLED ON NULL INPUT
RETURNS int
LANGUAGE java AS 'return Integer.parseInt(type)+state;' ;
CREATE OR REPLACE AGGREGATE aggr_sum(text)
SFUNC sum_fun
STYPE int
INITCOND {};
error message:
InvalidRequest: code=2200 [Invalid query] message="Invalid set literal for (aggregate_initcond) of type int"
cassandra version: 2.2