problem solved !!!

INITCOND {}  should be INITCOND 0


原始邮件
发件人:lowpinglowp...@163.com
收件人:useru...@cassandra.apache.org
发送时间:2016年6月27日(周一) 16:03
主题: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

Reply via email to