Hi,

Thanks for the quick response. In fact, I am using a branch which forked the 
version 1.6. I implemented an AggregateFunction UDF which is used in Flink SQL. 
The idea is to do groupBy with this UDF and add a metric inside the UDF to 
track the size of aggregated array. I have override the open method and it 
seemed it was not called. But I tried with the latest version it worked. I am 
wondering if there was a problem in 1.6 and it has been fixed in the following 
releases.

Regards,
Guobao

From: Jingsong Li <jingsongl...@gmail.com>
Date: Wednesday 4 December 2019 at 04:23
To: Biao Liu <mmyy1...@gmail.com>
Cc: Guobao Li <gu...@criteo.com>, "user@flink.apache.org" 
<user@flink.apache.org>
Subject: Re: A problem of open in AggregateFunction

Hi Guobao,

Looks like this is from table/SQL API.
You can override public void open(FunctionContext context)
It should work, can you provide more information? Like:
- version
- which planner
- what problem, open method never being invoked?

Best,
Jingsong Lee

On Wed, Dec 4, 2019 at 11:09 AM Biao Liu 
<mmyy1...@gmail.com<mailto:mmyy1...@gmail.com>> wrote:
Hi Guobao,

Are you using table API? I'm not familiar with table API, but for data stream 
API, generally speaking user could do some initialization through "open" method 
of "Rich" function, like "RichAggregateFunction".

Thanks,
Biao /'bɪ.aʊ/



On Tue, 3 Dec 2019 at 22:44, Guobao Li 
<gu...@criteo.com<mailto:gu...@criteo.com>> wrote:
Hi community,

I am trying to register a metric in an aggregate UDF by overriding the open 
function. According to the documentation, the open function can be override in 
order to retrieve the metric group to do the metric registration. But it works 
only on ScalarFunction not on AggregateFunction. Since the open function is not 
invoked by AggregateFunction. Could anyone help me out of it?

Thanks,
Guobao



--
Best, Jingsong Lee

Reply via email to