davidradl commented on code in PR #26350:
URL: https://github.com/apache/flink/pull/26350#discussion_r2012269755
##########
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:
I am curious
- when can we have more than one primary key? I assume this is an unenforced
constraint
- If so should we have a test for multiples?
- if we can have more than one primary key ,should put the keys in index
order? Or will they already be in order due to how they come back from
getColumns().
--
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]