Re: The way to write a UDF with generic type

Posted by Chesnay Schepler on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/The-way-to-write-a-UDF-with-generic-type-tp25329p25332.html

I believe you have to extend
"org.apache.flink.table.functions.AggregateFunction" instead for it to
work with SQL (or more generally speaking, any sub-class of
"org.apache.flink.table.functions.UserDefinedFunction".

On 04.01.2019 05:18, yinhua.dai wrote:

> Hi Community,
>
> I tried to write a UDF with generic type, but seems that Flink will complain
> not recognizing the type information when I use it in SQL.
>
> I checked the implementation of native function "MAX" and realize that it's
> not using the same API(AggregationFunction e.g.) as user defined function,
> is that the reason why "MAX" doesn't have the generic type issue?
>
> How can I implement my own "MAX" function which could support all types?
> Thanks.
>
>
>
> --
> Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/
>