alexeykudinkin commented on code in PR #6727:
URL: https://github.com/apache/hudi/pull/6727#discussion_r980446077


##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieCommitMetadata.java:
##########
@@ -236,6 +241,44 @@ public static <T> T fromJsonString(String jsonStr, 
Class<T> clazz) throws Except
     return JsonUtils.getObjectMapper().readValue(jsonStr, clazz);
   }
 
+  /**
+   * parse the bytes of deltacommit, and get the base file and the log files 
belonging to this
+   * provided file group.
+   */
+  // TODO: refactor this method to avoid doing the json tree walking 
(HUDI-4822).
+  public static Option<Pair<String, List<String>>> 
getFileSliceForFileGroupFromDeltaCommit(
+      byte[] bytes, HoodieFileGroupId fileGroupId) {
+    String jsonStr = new String(bytes, StandardCharsets.UTF_8);
+    if (jsonStr.isEmpty()) {
+      return Option.empty();
+    }
+
+    try {
+      JsonNode ptToWriteStatsMap = 
JsonUtils.getObjectMapper().readTree(jsonStr).get("partitionToWriteStats");

Review Comment:
   @YannByron we might not have the method to get all the log files but we 
shouldn't be producing new methods for deserializing `HoodieCommitMetadata` if 
we already have the methods to do so. Let's follow-up on this one.



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