cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "lowping"<lowp...@163.com>
Subject 回复:UDA can't use int or text as state_type
Date Mon, 27 Jun 2016 08:24:11 GMT
problem solved !!!


INITCOND {}  should be INITCOND 0


原始邮件
发件人:lowpinglowping@163.com
收件人:useruser@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
Mime
View raw message