Dawid Wysakowicz created FLINK-37557: ----------------------------------------
Summary: 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: 1.20.1, 2.0.0, 2.1.0 Reporter: Dawid Wysakowicz Assignee: Dawid Wysakowicz 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)