Hi Edward,

Do you mean that using Python UDF in the Java DataStream API job? If so, there 
is still no plan to support this directly in the Java DataStream API.

However, there is one way to achieve this as it supports to use Python UDF in 
the Java Table API, so you can do as following:
- Convert DataStream to Table
- Use Python UDF in the Table API
- Convert Table back to DataStream

You can refer [1] for more details on how to use Python UDF in the Java Table 
API.

[1] 
https://github.com/apache/flink/blob/b51101bdeb1d7052d0a89ee51c9342aeed5bd153/flink-end-to-end-tests/flink-python-test/src/main/java/org/apache/flink/python/tests/BlinkBatchPythonUdfSqlJob.java
 
<https://github.com/apache/flink/blob/b51101bdeb1d7052d0a89ee51c9342aeed5bd153/flink-end-to-end-tests/flink-python-test/src/main/java/org/apache/flink/python/tests/BlinkBatchPythonUdfSqlJob.java>

Regards,
Dian

> 在 2020年9月17日,上午2:38,Edward <egb...@hotmail.com> 写道:
> 
> Is there any plan to allow Python UDF's within the DataStream API (as opposed 
> to an entire job defined in Python)? FLIP-130 
> <https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=158866298> 
> discusses Python support for the DataStream API, but it's not clear whether 
> this will include the ability to have a single Python UDF (similar to FLIP-58 
> <https://cwiki.apache.org/confluence/display/FLINK/FLIP-58%3A+Flink+Python+User-Defined+Stateless+Function+for+Table>,
>  but for DataSteam API, not Table API) 
> Sent from the Apache Flink User Mailing List archive. mailing list archive 
> <http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/> at 
> Nabble.com.

Reply via email to