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


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/HoodieTableFactory.java:
##########
@@ -217,31 +217,33 @@ private static void setupHoodieKeyOptions(Configuration 
conf, CatalogTable table
       }
     }
 
-    // tweak the key gen class if possible
-    final String[] partitions = 
conf.getString(FlinkOptions.PARTITION_PATH_FIELD).split(",");
-    final String[] pks = 
conf.getString(FlinkOptions.RECORD_KEY_FIELD).split(",");
-    if (partitions.length == 1) {
-      final String partitionField = partitions[0];
-      if (partitionField.isEmpty()) {
-        conf.setString(FlinkOptions.KEYGEN_CLASS_NAME, 
NonpartitionedAvroKeyGenerator.class.getName());
-        LOG.info("Table option [{}] is reset to {} because this is a 
non-partitioned table",
-            FlinkOptions.KEYGEN_CLASS_NAME.key(), 
NonpartitionedAvroKeyGenerator.class.getName());
-        return;
+    if (StringUtils.isNullOrEmpty(conf.get(FlinkOptions.KEYGEN_CLASS_NAME))) {
+      // tweak the key gen class if possible

Review Comment:
   In https://github.com/apache/hudi/pull/5815, we have fixed the spark sql to 
use `NonpartitionedKeyGenerator` for non partitioned table.



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