lincoln lee created FLINK-40153:
-----------------------------------

             Summary: CREATE TABLE LIKE cannot resolve inherited metadata 
columns in a derived watermark expression
                 Key: FLINK-40153
                 URL: https://issues.apache.org/jira/browse/FLINK-40153
             Project: Flink
          Issue Type: Bug
    Affects Versions: 1.20.5, 2.2.1, 2.3.0
            Reporter: lincoln lee
            Assignee: lincoln lee
             Fix For: 2.3.1


When a table created with CREATE TABLE LIKE inherits a metadata column from
  the source table, a newly declared watermark expression cannot reference that
  metadata column.

  For example:

{code} 

  CREATE TABLE LikeSourceTable (
    `ts` TIMESTAMP(3),
    `opts` TIMESTAMP(3) METADATA VIRTUAL,
    WATERMARK FOR `ts` AS `ts`
  ) WITH (
    'connector' = 'values',
    'readable-metadata' = 'opts:TIMESTAMP(3)'
  );

  CREATE TABLE LikeSourceWithWatermark (
    WATERMARK FOR `opts` AS `opts` - INTERVAL '5' SECOND
  ) LIKE LikeSourceTable (
    EXCLUDING WATERMARKS
  );

{code}

 

The second CREATE TABLE statement fails during SQL validation with:

  Unknown identifier 'opts'



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

Reply via email to