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


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/configuration/FlinkOptions.java:
##########
@@ -875,6 +883,33 @@ public static <T> boolean 
isDefaultValueDefined(Configuration conf, ConfigOption
         || conf.get(option).equals(option.defaultValue());
   }
 
+  public static String getKeyGenClassNameByType(Configuration conf) {
+    String genType = conf.get(FlinkOptions.KEYGEN_TYPE);

Review Comment:
   If `KEYGEN_CLASS_NAME` is not set, this field will not be displayed in the 
table properties. 
   `KEYGEN_TYPE` is equivalent to an alias of `KEYGEN_CLASS_NAME`, so 
`KEYGEN_TYPE` can be read here to initialize `KEYGEN_CLASS_NAME`. And the 
default value of `KEYGEN_TYPE` is `SIMPLE`, so `KEYGEN_CLASS_NAME` will be set 
to `SimpleAvroKeyGenerator` by default.
   
   According to the above logic, if the user does not set `KEYGEN_CLASS_NAME`, 
`KEYGEN_CLASS_NAME` can be replaced by setting `KEYGEN_TYPE`, and after 
setting, `KEYGEN_CLASS_NAME` will also be stored in the table propeties. In 
this way, the function of `KEYGEN_TYPE` not only conforms to the original 
logic, but also conforms to the description in the document.



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