cshuo commented on code in PR #18738:
URL: https://github.com/apache/hudi/pull/18738#discussion_r3240647519


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/catalog/HoodieCatalog.java:
##########
@@ -314,9 +314,6 @@ public void createTable(ObjectPath tablePath, 
CatalogBaseTable catalogTable, boo
     Configuration conf = Configuration.fromMap(options);
     conf.set(FlinkOptions.PATH, tablePathStr);
     ResolvedSchema resolvedSchema = resolvedTable.getResolvedSchema();
-    if (!resolvedSchema.getPrimaryKey().isPresent() && 
!conf.containsKey(RECORD_KEY_FIELD.key())) {
-      throw new CatalogException("Primary key definition is missing");
-    }

Review Comment:
   Can we keep the early validation that only skips
     the check when OPERATION=insert:
   ```
     if (!resolvedSchema.getPrimaryKey().isPresent() && 
!conf.containsKey(RECORD_KEY_FIELD.key())
         && !OptionsResolver.isAppendMode(conf)) {
       throw new CatalogException("Primary key definition is missing");
     }
   ```



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