[
https://issues.apache.org/jira/browse/FLINK-26712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17508205#comment-17508205
]
Timo Walther commented on FLINK-26712:
--------------------------------------
The error is an internal shortcoming that should be easy to fix by adapting the
generated row type passed from
{{org.apache.flink.table.connector.source.abilities.SupportsReadingMetadata#applyReadableMetadata}}
> Metadata keys should not conflict with physical columns
> -------------------------------------------------------
>
> Key: FLINK-26712
> URL: https://issues.apache.org/jira/browse/FLINK-26712
> Project: Flink
> Issue Type: Sub-task
> Components: Table SQL / API
> Reporter: Timo Walther
> Priority: Major
>
> If you have an field called timestamp and in addition want to read the
> timestamp from the metadata:
> {code}
> CREATE TABLE animal_sightings_with_metadata (
> `timestamp` TIMESTAMP(3),
> `name` STRING,
> `country` STRING,
> `number` INT,
> `append_time` TIMESTAMP(3) METADATA FROM 'timestamp',
> `partition` BIGINT METADATA VIRTUAL,
> `offset` BIGINT METADATA VIRTUAL,
> `headers` MAP<STRING, BYTES> METADATA,
> `timestamp-type` STRING METADATA,
> `leader-epoch` INT METADATA,
> `topic` STRING METADATA
> )
> {code}
> This gives:
> {code}
> [ERROR] Could not execute SQL statement. Reason:
> org.apache.flink.table.api.ValidationException: Field names must be unique.
> Found duplicates: [timestamp]
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)