[ 
https://issues.apache.org/jira/browse/FLINK-28346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17561444#comment-17561444
 ] 

lincoln lee commented on FLINK-28346:
-------------------------------------

This is my misunderstanding, the extra cast operation is expected and does not 
map to the error type (though meta data keys were reordered, the execution plan 
was equivalent), so close this jira.

> 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)

Reply via email to