[
https://issues.apache.org/jira/browse/FLINK-26712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17509787#comment-17509787
]
jinfeng commented on FLINK-26712:
---------------------------------
[~twalthr] Currently, when there is a metacolumn, it will scan which
metacolumns are used, and pass these fields to the source, and then the source
will generate the corresponding columns according to the metakey, and then
generate a project node to map the metacolumn to the actual field.
This means that even if there are multiple fields referencing the same metakey,
the source only needs produce one metacolumn. If we need to modify it, it means
that we need to generate multiple metacolumns on the source side, and then
refer to the fields of the project node.
Will this affect the compatibility of SQL plan generation?
> 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)