[
https://issues.apache.org/jira/browse/FLINK-37557?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated FLINK-37557:
-----------------------------------
Labels: pull-request-available (was: )
> ResolvedSchema#getPrimaryKeyIndexes does not filter for physical columns
> ------------------------------------------------------------------------
>
> Key: FLINK-37557
> URL: https://issues.apache.org/jira/browse/FLINK-37557
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / API
> Affects Versions: 2.0.0, 1.20.1, 2.1.0
> Reporter: Dawid Wysakowicz
> Assignee: Dawid Wysakowicz
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.20.2, 2.1.0, 2.0.1
>
>
> 1. Primary keys can be defined only on physical columns
> 2. In multiple places we assume it's applied on physical row data type e.g.
> https://github.com/apache/flink/blob/b5dcb856c05694c524149715b58455b0825cc961/flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/DynamicTableFactory.java#L186
> {code}
> * // Create key data type
> * DataType keyDataType =
> Projection.of(context.getPrimaryKeyIndexes())
> * .project(context.getPhysicalRowDataType());
> {code}
> However, if metadata or computed columns are declared before physical columns
> this won't work.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)