You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Yun Gao (Jira)" <ji...@apache.org> on 2022/04/13 06:28:07 UTC

[jira] [Updated] (FLINK-15973) Optimize the execution plan where it refers the Python UDF result field in the where clause

     [ https://issues.apache.org/jira/browse/FLINK-15973?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yun Gao updated FLINK-15973:
----------------------------
    Fix Version/s: 1.16.0

> Optimize the execution plan where it refers the Python UDF result field in the where clause
> -------------------------------------------------------------------------------------------
>
>                 Key: FLINK-15973
>                 URL: https://issues.apache.org/jira/browse/FLINK-15973
>             Project: Flink
>          Issue Type: Improvement
>          Components: API / Python
>            Reporter: Dian Fu
>            Priority: Minor
>              Labels: auto-deprioritized-major, auto-unassigned
>             Fix For: 1.15.0, 1.16.0
>
>
> For the following job:
> {code}
> t_env.register_function("inc", inc)
> table.select("inc(id) as inc_id") \
>          .where("inc_id > 0") \
>          .insert_into("sink")
> {code}
> The execution plan is as following:
> {code}
> StreamExecPythonCalc(select=inc(f0) AS inc_id))
> +- StreamExecCalc(select=id AS f0, where=>(f0, 0))
> +--- StreamExecPythonCalc(select=id, inc(f0) AS f0))
> +-----StreamExecCalc(select=id, id AS f0))
> +-------StreamExecTableSourceScan(fields=id)
> {code}
> The plan is not the best. It could be optimized as following:
> {code}
> StreamExecCalc(select=f0, where=>(f0, 0))
> +- StreamExecPythonCalc(select=inc(f0) AS f0))
> +---StreamExecCalc(select=id, id AS f0))
> +-----StreamExecTableSourceScan(fields=id)
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)