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

Leonard Xu updated FLINK-15366:
-------------------------------
        Parent: FLINK-16824
    Issue Type: Sub-task  (was: Bug)

> Improve FlinkCalcMergeRule to merge calc nodes better
> -----------------------------------------------------
>
>                 Key: FLINK-15366
>                 URL: https://issues.apache.org/jira/browse/FLINK-15366
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table SQL / Planner
>    Affects Versions: 1.10.0
>            Reporter: Leonard Xu
>            Assignee: Leonard Xu
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.12.0
>
>
> FlinkCalcMergeRule should merge calc nodes when outer calc do not contains 
> inner calc's fields, the following logical plan can not merge as expected 
> currently:
> {code:java}
> FlinkLogicalJoin(condition=[AND(=($0, $4), >($1, 1))], joinType=[left])
>       :- FlinkLogicalCalc(select=[id, len, content], where=[>(id, 1)])
>       :  +- FlinkLogicalTableSourceScan(table=[[default_catalog, 
> default_database, T]], fields=[id, len, content])
>       +- FlinkLogicalSnapshot(period=[$cor0.proctime])
>          +- FlinkLogicalCalc(select=[age, id, name], where=[AND(>(age, 20), 
> =(name, _UTF-16LE'Fabian':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"))])
>             +- FlinkLogicalCalc(select=[age, id, name, PROCTIME() AS 
> proctime])
>                +- FlinkLogicalTableSourceScan(table=[[default_catalog, 
> default_database, userTable]], fields=[age, id, name])
> {code}
> The corresponding SQL to reproduce this issue:
> {code:java}
>  CREATE TABLE userTable (
>        `id` BIGINT,
>        `len` BIGINT,
>        `content` STRING,
>        `proctime` AS PROCTIME()
>        ) WITH (
>        'connector' = 'values',
>        'data-id' = '$dataId',
>        'bounded' = 'true'
>  )
> SELECT T.id, T.len, T.content, D.name FROM T JOIN userTable " +
>   "for system_time as of T.proctime AS D ON T.id = D.id
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to