You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Huang Xingbo (Jira)" <ji...@apache.org> on 2021/03/18 08:19:00 UTC
[jira] [Created] (FLINK-21856) Fix the bug of using Python UDF from
sub-query as input param of Python UDTF
Huang Xingbo created FLINK-21856:
------------------------------------
Summary: Fix the bug of using Python UDF from sub-query as input param of Python UDTF
Key: FLINK-21856
URL: https://issues.apache.org/jira/browse/FLINK-21856
Project: Flink
Issue Type: Bug
Components: API / Python
Affects Versions: 1.12.2, 1.11.3, 1.13.0
Reporter: Huang Xingbo
This example comes from the user. splitStr is a Python UDTF. train_and_predict is a Python UDF.
{code:python}
t_env.sql_query("""
select A.hotime ,
A.before_ta ,
A.before_rssi ,
A.after_ta ,
A.after_rssil ,
A.nb_tath ,
A.nb_rssith ,
nbr_rssi ,
nbr_ta
from (SELECT
hotime ,
before_ta ,
before_rssi ,
after_ta ,
after_rssil ,
nb_tath ,
nb_rssith ,
train_and_predict(nb_tath, nb_rssith) predict
FROM
source) as A,LATERAL TABLE(splitStr(predict)) as T(nbr_rssi, nbr_ta)
""")
{code}
The root cause is that `train_and_predict` is a RexCorrelVariable which we don't have relevant logic to deal with.
A workaround is to use the Table API.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)