You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/02/14 11:32:01 UTC

[GitHub] [hudi] xiarixiaoyao commented on a change in pull request #4785: [HUDI-3408] fixed the bug that BUCKET_INDEX cannot process special ch…

xiarixiaoyao commented on a change in pull request #4785:
URL: https://github.com/apache/hudi/pull/4785#discussion_r805752004



##########
File path: hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/bucket/BucketIdentifier.java
##########
@@ -43,7 +43,7 @@ public static int getBucketId(HoodieKey hoodieKey, String indexKeyFields, int nu
     } else {
       Map<String, String> recordKeyPairs = Arrays.stream(hoodieKey.getRecordKey().split(","))
           .map(p -> p.split(":"))
-          .collect(Collectors.toMap(p -> p[0], p -> p[1]));
+          .collect(Collectors.toMap(p -> p[0], p -> p.length == 1 ? "" : p[1]));
       hashKeyFields = Arrays.stream(indexKeyFields.split(","))

Review comment:
       Our users use a composite primary key (col1, col2, col3). The value of col3 contains special characters
   This problem occurs as long as the column value consists of ':'




-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org