danny0405 commented on code in PR #9590:
URL: https://github.com/apache/hudi/pull/9590#discussion_r1323834878
##########
hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableMetaClient.java:
##########
@@ -447,7 +450,14 @@ public void validateTableProperties(Properties properties)
{
// Meta fields can be disabled only when either {@code
SimpleKeyGenerator}, {@code ComplexKeyGenerator}, {@code
NonpartitionedKeyGenerator} is used
if (!getTableConfig().populateMetaFields()) {
- String keyGenClass =
properties.getProperty(HoodieTableConfig.KEY_GENERATOR_CLASS_NAME.key(),
"org.apache.hudi.keygen.SimpleKeyGenerator");
+ String keyGenClass;
+ if (properties.containsKey(HoodieTableConfig.KEY_GENERATOR_TYPE.key())) {
+ keyGenClass =
KeyGeneratorType.valueOf(properties.getProperty(HoodieTableConfig.KEY_GENERATOR_TYPE.key())).getClassName();
+ } else if
(properties.containsKey(HoodieTableConfig.KEY_GENERATOR_CLASS_NAME.key())) {
+ keyGenClass =
properties.getProperty(HoodieTableConfig.KEY_GENERATOR_CLASS_NAME.key());
+ } else {
+ keyGenClass = "org.apache.hudi.keygen.SimpleKeyGenerator";
Review Comment:
Can we also move this constant class name
"org.apache.hudi.keygen.SimpleKeyGenerator" into `KeyGeneratorType`.
--
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]