You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Jark Wu (Jira)" <ji...@apache.org> on 2020/07/27 12:49:00 UTC
[jira] [Assigned] (FLINK-18548) Improve FlinkCalcMergeRule to merge
calc nodes better
[ https://issues.apache.org/jira/browse/FLINK-18548?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jark Wu reassigned FLINK-18548:
-------------------------------
Assignee: Leonard Xu
> Improve FlinkCalcMergeRule to merge calc nodes better
> -----------------------------------------------------
>
> Key: FLINK-18548
> URL: https://issues.apache.org/jira/browse/FLINK-18548
> Project: Flink
> Issue Type: Improvement
> Components: Table SQL / Planner
> Affects Versions: 1.12.0
> Reporter: Leonard Xu
> Assignee: Leonard Xu
> Priority: Major
> Labels: pull-request-available
>
> 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)