You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by zhouhaifengmath <zh...@gmail.com> on 2022/05/12 06:33:46 UTC

How to test Flink SQL UDF with open method?

Hi,

I am trying to test a flink sql udf which has open method to get some
parameters with Flink1.14, but i can't find an example to set those parameters
in a test. Can someone give me a example on this question? Thanks for your
help~  
  

Thanks && Regards

[![](https://mail-online.nosdn.127.net/qiyelogo/defaultAvatar.png)|
zhouhaifengmath  
---|---  
zhouhaifengmath@gmail.com  
](https://maas.mail.163.com/dashi-web-
extend/html/proSignature.html?ftlId=1&name=zhouhaifengmath&uid=zhouhaifengmath%40gmail.com&iconUrl=https%3A%2F%2Fmail-
online.nosdn.127.net%2Fqiyelogo%2FdefaultAvatar.png&items=%5B%22zhouhaifengmath%40gmail.com%22%5D)


Re: How to test Flink SQL UDF with open method?

Posted by zhouhaifengmath <zh...@gmail.com>.
I register my job parameters as flink global parameters, and I need to get
those parameters in udf's open method like:

![](cid:20404987-0231-4D0F-8B11-DDBB091E0345@mailmaster)  

  

I know in DataStream API there are test harnesses to test user-defined
functions as shows in docs:

![](cid:8198FEF2-F116-4773-9222-FDE245ACAC3E@mailmaster)  

  

So I wonder is there a similar way in Table/SQL API to set global parameters?

  

[![](https://mail-online.nosdn.127.net/qiyelogo/defaultAvatar.png)|
zhouhaifengmath  
---|---  
zhouhaifengmath@gmail.com  
](https://maas.mail.163.com/dashi-web-
extend/html/proSignature.html?ftlId=1&name=zhouhaifengmath&uid=zhouhaifengmath%40gmail.com&iconUrl=https%3A%2F%2Fmail-
online.nosdn.127.net%2Fqiyelogo%2FdefaultAvatar.png&items=%5B%22zhouhaifengmath%40gmail.com%22%5D)

On 5/12/2022 19:29,[Zhanghao
Chen<zh...@outlook.com>](mailto:zhanghao.chen@outlook.com) wrote:

> Hi,
>
>  
>
>
> What kind of parameters do you want to get, Flink global job parameters, or
> some other parameters?
>
>  
>
>
> Best,
>
> Zhanghao Chen
>
> * * *
>
> **From:** zhouhaifengmath <zh...@gmail.com>  
>  **Sent:** Thursday, May 12, 2022 14:33  
>  **To:** user@flink.apache.org <us...@flink.apache.org>  
>  **Subject:** How to test Flink SQL UDF with open method?
>
>  
>
> Hi,
>
> I am trying to test a flink sql udf which has open method to get some
> parameters with Flink1.14, but i can't find an example to set those
> parameters in a test. Can someone give me a example on this question? Thanks
> for your help~  
>  
>
>
> Thanks && Regards
>
> [ ![](https://mail-online.nosdn.127.net/qiyelogo/defaultAvatar.png) |
> zhouhaifengmath  
> ---|---  
> zhouhaifengmath@gmail.com  
> ](https://maas.mail.163.com/dashi-web-
> extend/html/proSignature.html?ftlId=1&name=zhouhaifengmath&uid=zhouhaifengmath%40gmail.com&iconUrl=https%3A%2F%2Fmail-
> online.nosdn.127.net%2Fqiyelogo%2FdefaultAvatar.png&items=%5B%22zhouhaifengmath%40gmail.com%22%5D)


Re: How to test Flink SQL UDF with open method?

Posted by Zhanghao Chen <zh...@outlook.com>.
Hi,

What kind of parameters do you want to get, Flink global job parameters, or some other parameters?

Best,
Zhanghao Chen
________________________________
From: zhouhaifengmath <zh...@gmail.com>
Sent: Thursday, May 12, 2022 14:33
To: user@flink.apache.org <us...@flink.apache.org>
Subject: How to test Flink SQL UDF with open method?

Hi,
I am trying to test a flink sql udf which has open method to get some parameters with Flink1.14, but i can't find an example to set those parameters in a test. Can someone give me a example on this question? Thanks for your help~

Thanks && Regards
<https://maas.mail.163.com/dashi-web-extend/html/proSignature.html?ftlId=1&name=zhouhaifengmath&uid=zhouhaifengmath%40gmail.com&iconUrl=https%3A%2F%2Fmail-online.nosdn.127.net%2Fqiyelogo%2FdefaultAvatar.png&items=%5B%22zhouhaifengmath%40gmail.com%22%5D>
[https://mail-online.nosdn.127.net/qiyelogo/defaultAvatar.png]
zhouhaifengmath
zhouhaifengmath@gmail.com