yihua commented on code in PR #11934:
URL: https://github.com/apache/hudi/pull/11934#discussion_r1767684006


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/keygen/KeyGenUtils.java:
##########
@@ -153,7 +154,12 @@ public static String getRecordKey(GenericRecord record, 
List<String> recordKeyFi
     StringBuilder recordKey = new StringBuilder();
     for (int i = 0; i < recordKeyFields.size(); i++) {
       String recordKeyField = recordKeyFields.get(i);
-      String recordKeyValue = 
HoodieAvroUtils.getNestedFieldValAsString(record, recordKeyField, true, 
consistentLogicalTimestampEnabled);
+      String recordKeyValue;
+      try {
+        recordKeyValue = HoodieAvroUtils.getNestedFieldValAsString(record, 
recordKeyField, false, consistentLogicalTimestampEnabled);

Review Comment:
   Also create a follow-up JIRA to revisit all places this method can return 
null for non-existent field.



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