TJX2014 commented on code in PR #6567:
URL: https://github.com/apache/hudi/pull/6567#discussion_r962451609
##########
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:
But user cannot assign keygen_class seems not friendly.
--
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]