davidradl commented on code in PR #26350:
URL: https://github.com/apache/flink/pull/26350#discussion_r2012302359


##########
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:
   Hi @dawidwys thanks for you quick response, that is why I was curious - we 
return an array when there can only be one primary key. I assume there can be 
never be 2 elements in this array.    



-- 
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]

Reply via email to