wuwenchi commented on code in PR #6539:
URL: https://github.com/apache/hudi/pull/6539#discussion_r958351246


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/keygen/KeyGenUtils.java:
##########
@@ -73,21 +73,16 @@ public static String 
getPartitionPathFromGenericRecord(GenericRecord genericReco
    */
   public static String[] extractRecordKeys(String recordKey) {
     String[] fieldKV = recordKey.split(",");
-    if (fieldKV.length == 1) {
-      return fieldKV;
-    } else {
-      // a complex key
-      return Arrays.stream(fieldKV).map(kv -> {
-        final String[] kvArray = kv.split(":");
-        if (kvArray[1].equals(NULL_RECORDKEY_PLACEHOLDER)) {
-          return null;
-        } else if (kvArray[1].equals(EMPTY_RECORDKEY_PLACEHOLDER)) {
-          return "";
-        } else {
-          return kvArray[1];
-        }
-      }).toArray(String[]::new);
-    }
+    return Arrays.stream(fieldKV).map(kv -> {
+      final String[] kvArray = kv.split(":");
+      if (kvArray[1].equals(NULL_RECORDKEY_PLACEHOLDER)) {
+        return null;
+      } else if (kvArray[1].equals(EMPTY_RECORDKEY_PLACEHOLDER)) {
+        return "";
+      } else {
+        return kvArray[1];
+      }
+    }).toArray(String[]::new);

Review Comment:
   Here's what I know so far. If it is delete type data, hudi will use 
`DeleteRecord#create` to generate `DeleteRecord` according to the data. This 
class records the `HoodieKey` and then writes it to the avro log file. When the 
log is read, data of type `HoodieAvroRecord` is generated, and the 
`getRecordKey` method is called to obtain the primary key information of the 
data. 



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