Re: Impalad crash when use uda in sql

2019-06-25 Thread Tim Armstrong
The UDA uses a STRING to store the intermediate value. The default if intermediate is not specified is for the intermediate type to be the same as the output type. On Mon, Jun 24, 2019 at 11:31 PM skyyws wrote: > Thanks for your advice, and this method works. > But I don’t understand why 'interm

Re: Impalad crash when use uda in sql

2019-06-24 Thread skyyws
Thanks for your advice, and this method works. But I don’t understand why 'intermediate' is necessary for this uda, and when do I need to add ‘intermediate’ in my own uda? And I think this 'intermediate' is unfriendly to use, is this a history problem? | | skyyws | | sky...@163.com | 签名由网易邮箱大师定

Re: Impalad crash when use uda in sql

2019-06-24 Thread Tim Armstrong
I think you need to declare the intermediate to be a string. E.g. here's a declaration of an aggregate function from our tets. create aggregate function agg_string_intermediate(decimal(20,10), bigint, string) returns decimal(20,0) intermediate string location '/path/to/lib.so' init_fn='AggStringI

Impalad crash when use uda in sql

2019-06-23 Thread skyyws
Hi all, Recently, I tested the uda avg() in uda-sample.cc, and then impalad crash. Here is the funciton created sql: CREATE AGGREGATE FUNCTION avg_test(double) RETURNS double LOCATION '/user/impala/udf/libudasample.so' UPDATE_FN='_Z9AvgUpdatePN10impala_udf15FunctionContextERKNS_9DoubleValEPPh