[ https://issues.apache.org/jira/browse/FLINK-28650?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17570124#comment-17570124 ]
Jun Qin commented on FLINK-28650: --------------------------------- Thanks [~JasonLee]. Your example indeed works, and it is included in my description above. The JIRA is to fix the issue when column names are explicitly specified. [~jark] FYI > Flink SQL Parsing bug for METADATA > ---------------------------------- > > Key: FLINK-28650 > URL: https://issues.apache.org/jira/browse/FLINK-28650 > Project: Flink > Issue Type: Bug > Affects Versions: 1.14.4 > Reporter: Jun Qin > Priority: Major > > With the following source/sink tables: > {code:sql} > CREATE TABLE sourceTable ( > `key` INT, > `time` TIMESTAMP(3), > `value` STRING NOT NULL, > id INT > ) > WITH ( > 'connector' = 'datagen', > 'rows-per-second'='10', > 'fields.id.kind'='sequence', > 'fields.id.start'='1', > 'fields.id.end'='100' > ); > CREATE TABLE sinkTable1 ( > `time` TIMESTAMP(3) METADATA FROM 'timestamp', > `value` STRING NOT NULL > ) > WITH ( > 'connector' = 'kafka', > ... > ) > CREATE TABLE sinkTable2 ( > `time` TIMESTAMP(3), -- without METADATA > `value` STRING NOT NULL > ) > WITH ( > 'connector' = 'kafka', > ... > ) > {code} > the following three pass the validation: > {code:sql} > INSERT INTO sinkTable1 > SELECT > `time`, > `value` > FROM sourceTable; > INSERT INTO sinkTable2 > SELECT > `time`, > `value` > FROM sourceTable; > INSERT INTO sinkTable2 (`time`,`value`) > SELECT > `time`, > `value` > FROM sourceTable; > {code} > but this one does not: > {code:sql} > INSERT INTO sinkTable1 (`time`,`value`) > SELECT > `time`, > `value` > FROM sourceTable; > {code} > It failed with > {code:java} > Unknown target column 'time' > {code} > It seems when providing column names in INSERT, the METADATA have an > undesired effect. -- This message was sent by Atlassian Jira (v8.20.10#820010)