dawidwys commented on code in PR #26350:
URL: https://github.com/apache/flink/pull/26350#discussion_r2012282592
##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/ResolvedSchema.java:
##########
@@ -163,9 +163,16 @@ public Optional<UniqueConstraint> getPrimaryKey() {
return Optional.ofNullable(primaryKey);
}
- /** Returns the primary key indexes, if any, otherwise returns an empty
array. */
+ /**
+ * Returns the primary key indexes in the {@link
#toPhysicalRowDataType()}, if any, otherwise
+ * returns an empty array.
+ */
public int[] getPrimaryKeyIndexes() {
- final List<String> columns = getColumnNames();
+ final List<String> columns =
+ getColumns().stream()
+ .filter(Column::isPhysical)
Review Comment:
@davidradl Have you checked the interfaces?
https://github.com/apache/flink/blob/960a253e8bd8c80d8fce1bd7eb55d6aab16936ca/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/ResolvedSchema.java#L162
One can not have multiple primary keys. You can also check SQL standard
which says you can only have one PRIMARY KEY. That's where `PRIMARY` come from.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]