danny0405 commented on a change in pull request #12275:
URL: https://github.com/apache/flink/pull/12275#discussion_r430989999



##########
File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java
##########
@@ -669,6 +677,14 @@ public DataType getDataType(String key) {
                        }
                }
 
+               // Extract unique constraints.
+               String pkConstraintNameKey = key + '.' + PRIMARY_KEY_NAME;
+               final Optional<String> pkConstraintNameOpt = 
optionalGet(pkConstraintNameKey);
+               if (pkConstraintNameOpt.isPresent()) {
+                       final String pkColumnsKey = key + '.' + 
PRIMARY_KEY_COLUMNS;
+                       final String columns = 
optionalGet(pkColumnsKey).orElseThrow(exceptionSupplier(pkColumnsKey));
+                       schemaBuilder.primaryKey(pkConstraintNameOpt.get(), 
columns.split(","));
+               }

Review comment:
       I think it is not necessary, the `schema.primary-key.columns` should 
never appear as a single(e.g. comes from `#putTableSchema`).




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to