You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "lincoln lee (Jira)" <ji...@apache.org> on 2022/07/01 12:50:00 UTC

[jira] [Closed] (FLINK-28346) Wrong plan when selects metadata in a different order against ddl

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

lincoln lee closed FLINK-28346.
-------------------------------
    Resolution: Invalid

> Wrong plan when selects metadata in a different order against ddl
> -----------------------------------------------------------------
>
>                 Key: FLINK-28346
>                 URL: https://issues.apache.org/jira/browse/FLINK-28346
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Planner
>    Affects Versions: 1.15.0
>            Reporter: lincoln lee
>            Priority: Major
>             Fix For: 1.16.0
>
>
> The following query will get a wrong plan:
> {code}
> @Test
> def testReadsMetaDataWithDifferentOrder(): Unit = {
> val ddl =
> s"""
> |CREATE TABLE src (
> | id int,
> | name varchar,
> | tags varchar METADATA VIRTUAL,
> | op varchar METADATA VIRTUAL,
> | ts timestamp(3) METADATA VIRTUAL
> |) WITH (
> | 'connector' = 'values',
> | 'readable-metadata'='tags:varchar,op:varchar,ts:timestamp(3)',
> | 'enable-projection-push-down' = 'false'
> |)""".stripMargin
> util.tableEnv.executeSql(ddl)
> util.verifyExecPlan("SELECT id, name, ts, tags, op FROM src")
> }
> {code}
>  
> {code}
> Calc(select=[id, name, ts, CAST(tags AS VARCHAR(2147483647)) AS tags, CAST(op AS VARCHAR(2147483647)) AS op])
> +- TableSourceScan(table=[[default_catalog, default_database, src]], fields=[id, name, op, tags, ts])
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)