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


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/catalog/HoodieHiveCatalog.java:
##########
@@ -493,10 +493,13 @@ private void initTableIfNotExists(ObjectPath tablePath, 
CatalogTable catalogTabl
     // because the HoodieTableMetaClient is a heavy impl, we try to avoid 
initializing it
     // when calling #getTable.
 
-    if (catalogTable.getUnresolvedSchema().getPrimaryKey().isPresent()
-        && !flinkConf.contains(FlinkOptions.RECORD_KEY_FIELD)) {
-      final String pkColumns = String.join(",", 
catalogTable.getUnresolvedSchema().getPrimaryKey().get().getColumnNames());
-      flinkConf.setString(FlinkOptions.RECORD_KEY_FIELD, pkColumns);
+    if (!flinkConf.contains(FlinkOptions.RECORD_KEY_FIELD)) {
+      if (catalogTable.getUnresolvedSchema().getPrimaryKey().isPresent()) {
+        final String pkColumns = String.join(",", 
catalogTable.getUnresolvedSchema().getPrimaryKey().get().getColumnNames());
+        flinkConf.setString(FlinkOptions.RECORD_KEY_FIELD, pkColumns);

Review Comment:
   Why we must have a primary key definition then?



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