TJX2014 commented on code in PR #6567:
URL: https://github.com/apache/hudi/pull/6567#discussion_r962542029
##########
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:
Hudi configure keygen clazz auto is great, so the option should not exists,
once configured but not effect, is it strange?The code in spark has changed to
follow hudi-partition way, but in historical data, if the layout of
non-partitioned table with complex key by spark, the only chance for hudi-flink
it to configure keygen.
--
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]