Re: python udf with flinksql

2023-05-23 Thread tom yang
tion_context.get_metric_group().counter("my_counter") > > def eval(self, x, y): > self.counter.inc() > return x + y > > my_udf = udf(MyUDF(), result_type=DataTypes.BIGINT()) > ``` > > And then use it in SQL as following: > ``` > CREATE FUNCTION

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

python udf out of memory

2023-03-28 Thread tom yang
Hi, I am running a standalone cluster setup and submit flinksql job with python udf following the examples here github.com/ververica/flink-sql-cookbook/blob/main/udfs/01_python_udfs/01_python_udfs.md

asyhcnrouonous io question

2021-10-04 Thread tom yang
Hello, I have a recently ran into an issue with RichAsyncFunction and wanted to get some guidance from the community Please see snippet class AsyncFetchFromHttp extends RichAsyncFunction> {23    private transient AysncHttpClient client;45    @Override6    public void