lokeshj1703 commented on code in PR #11816:
URL: https://github.com/apache/hudi/pull/11816#discussion_r1774610413
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/keygen/KeyGenUtils.java:
##########
@@ -65,30 +65,35 @@ public class KeyGenUtils {
*/
public static KeyGeneratorType inferKeyGeneratorType(
Option<String> recordsKeyFields, String partitionFields) {
- boolean autoGenerateRecordKeys = !recordsKeyFields.isPresent();
- if (autoGenerateRecordKeys) {
- return inferKeyGeneratorTypeForAutoKeyGen(partitionFields);
+ int numRecordKeyFields = recordsKeyFields.map(fields ->
fields.split(",").length).orElse(0);
+ KeyGeneratorType partitionKeyGeneratorType =
inferKeyGeneratorTypeFromPartitionFields(partitionFields);
Review Comment:
@yihua I have added tests for SparkConfigUtils in
https://github.com/apache/hudi/pull/12000. PTAL.
I find the existing logic ok for inferring the key generator type. For
partition type it is not just numPartitionFields, it is also the custom keygen
which is the case where fields have `:` separator.
--
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]