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
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
|
签名由网易邮箱大师定
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
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