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


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/HoodieTableFactory.java:
##########
@@ -235,6 +235,11 @@ private static void setupHoodieKeyOptions(Configuration 
conf, CatalogTable table
       conf.setString(FlinkOptions.KEYGEN_CLASS_NAME, 
ComplexAvroKeyGenerator.class.getName());
       LOG.info("Table option [{}] is reset to {} because record key or 
partition path has two or more fields",
           FlinkOptions.KEYGEN_CLASS_NAME.key(), 
ComplexAvroKeyGenerator.class.getName());
+    } else if (!conf.getOptional(FlinkOptions.KEYGEN_CLASS_NAME).isPresent()) {
+      String keyGenName = FlinkOptions.getKeyGenClassNameByType(conf);
+      conf.setString(FlinkOptions.KEYGEN_CLASS_NAME, keyGenName);
+      LOG.info("Table option [{}] is reset to {} because of {}",
+          FlinkOptions.KEYGEN_CLASS_NAME.key(), keyGenName, 
FlinkOptions.KEYGEN_TYPE);

Review Comment:
   Can we fix StreamerUtil line 218 instead ? Just give a default value 
`SimpleAvroKeyGenerator` should be enough, and this is a table config, the 
write config key gen type could overwrite this.



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