[
https://issues.apache.org/jira/browse/FLINK-38793?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated FLINK-38793:
-----------------------------------
Labels: pull-request-available (was: )
> Reuse result of functions if ther are used multiple times as input for other
> functions
> --------------------------------------------------------------------------------------
>
> Key: FLINK-38793
> URL: https://issues.apache.org/jira/browse/FLINK-38793
> Project: Flink
> Issue Type: Bug
> Reporter: Sergey Nuyanzin
> Assignee: Sergey Nuyanzin
> Priority: Major
> Labels: pull-request-available
>
> An example
> {code:sql}
> SELECT LTRIM(q), RTRIM(q) FROM (SELECT TRIM(c) as q FROM MyTable) t
> {code}
> and plan shows
> {noformat}
> <Resource name="optimized exec plan">
> <![CDATA[
> Calc(select=[LTRIM(TRIM(BOTH, ' ', c)) AS EXPR$0, RTRIM(TRIM(BOTH, ' ', c))
> AS EXPR$1])
> +- TableSourceScan(table=[[default_catalog, default_database, MyTable]],
> fields=[a, b, c])
> ]]>
> </Resource>
> {noformat}
> which means {{TRIM(BOTH, ' ', c)}} here will be evaluated twice, in case of
> more usages like that it we be evaluated more times
--
This message was sent by Atlassian Jira
(v8.20.10#820010)