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



##########
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:
       Throw an exception if the the name is not present? 




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