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 2019/09/24 05:19:41 UTC

[GitHub] [incubator-hudi] bvaradar commented on a change in pull request #862: Add support for composite key

bvaradar commented on a change in pull request #862: Add support for composite key
URL: https://github.com/apache/incubator-hudi/pull/862#discussion_r327430680
 
 

 ##########
 File path: hudi-utilities/src/main/java/org/apache/hudi/utilities/keygen/TimestampBasedKeyGenerator.java
 ##########
 @@ -102,7 +109,12 @@ public HoodieKey getKey(GenericRecord record) {
             "Unexpected type for partition field: " + partitionVal.getClass().getName());
       }
 
-      return new HoodieKey(DataSourceUtils.getNestedFieldValAsString(record, recordKeyField),
+      return new HoodieKey(
+          fields.stream()
+              .map(
+                  recordKeyField ->
+                      DataSourceUtils.getNestedFieldValAsString(record, recordKeyField))
+              .collect(Collectors.joining(".")),
 
 Review comment:
   @jaimin-shah : Wondering if there is a necessity to decode the generated record key. If this is a one-way concatenation of fields to record-key, it should be fine. right ? As we are storing individual fields that constitute the record key separately, there wont be any need to decode this record key and  ambiguity during decoding should be ok. Isn't it ?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services