Re: python udf with flinksql

2023-05-23 Thread tom yang
Thanks Dian, that resolved my issues. On Sun, May 21, 2023 at 6:55 PM Dian Fu wrote: > > Hi Tom, > > The following statement is incorrect. > ``` > CREATE FUNCTION add AS 'custom_udf_2.MyUDF' > LANGUAGE PYTHON; > ``` > > You should define it as following: > custom_udf_2.py > ``` > from pyflink.tab

Re: python udf with flinksql

2023-05-21 Thread Dian Fu
Hi Tom, The following statement is incorrect. ``` CREATE FUNCTION add AS 'custom_udf_2.MyUDF' LANGUAGE PYTHON; ``` You should define it as following: custom_udf_2.py ``` from pyflink.table.udf import ScalarFunction, udf from pyflink.table import DataTypes class MyUDF(ScalarFunction): def __in

python udf with flinksql

2023-05-18 Thread tom yang
Hi I am trying to create a flinksql program using python udf & using metrics. This is my sample python file custom_udf_2.py ``` from pyflink.table.udf import ScalarFunction, udf from pyflink.table import DataTypes class MyUDF(ScalarFunction): def __init__(self): self.counter = None d