danny0405 commented on code in PR #10162:
URL: https://github.com/apache/hudi/pull/10162#discussion_r1407192799


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/catalog/HoodieCatalog.java:
##########
@@ -325,10 +326,19 @@ public void createTable(ObjectPath tablePath, 
CatalogBaseTable catalogTable, boo
     // because the HoodieTableMetaClient is a heavy impl, we try to avoid 
initializing it
     // when calling #getTable.
 
-    final String pkColumns = String.join(",", 
resolvedSchema.getPrimaryKey().get().getColumns());
-    conf.setString(FlinkOptions.RECORD_KEY_FIELD, pkColumns);
-    options.put(TableOptionProperties.PK_CONSTRAINT_NAME, 
resolvedSchema.getPrimaryKey().get().getName());
-    options.put(TableOptionProperties.PK_COLUMNS, pkColumns);
+    //set pk
+    if (resolvedSchema.getPrimaryKey().isPresent()
+            && !conf.containsKey(FlinkOptions.RECORD_KEY_FIELD.key())) {
+      final String pkColumns = String.join(",", 
resolvedSchema.getPrimaryKey().get().getColumns());

Review Comment:
   Does hudi hive catalog has this problem?



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