[
https://issues.apache.org/jira/browse/FLINK-40153?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated FLINK-40153:
-----------------------------------
Labels: pull-request-available (was: )
> 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: 2.3.0, 2.2.1, 1.20.5
> Reporter: lincoln lee
> Assignee: lincoln lee
> Priority: Major
> Labels: pull-request-available
> 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)