n3nash commented on a change in pull request #1009:  [HUDI-308] Avoid Renames 
for tracking state transitions of all actions on dataset
URL: https://github.com/apache/incubator-hudi/pull/1009#discussion_r356321928
 
 

 ##########
 File path: 
hudi-client/src/main/java/org/apache/hudi/io/HoodieCommitArchiveLog.java
 ##########
 @@ -169,7 +180,14 @@ public boolean archiveIfRequired(final JavaSparkContext 
jsc) throws IOException
       }).limit(commitTimeline.countInstants() - minCommitsToKeep));
     }
 
-    return instants;
+    // For archiving and cleaning instants, we need to include intermediate 
state files if they exist
+    HoodieActiveTimeline rawActiveTimeline = new 
HoodieActiveTimeline(metaClient, false);
+    Map<Pair<String, String>, List<HoodieInstant>> groupByTsAction = 
rawActiveTimeline.getInstants()
+        .collect(Collectors.groupingBy(x -> Pair.of(x.getTimestamp(),
+            x.getAction().equals(HoodieTimeline.COMPACTION_ACTION) ? 
HoodieTimeline.COMMIT_ACTION : x.getAction())));
+
+    return instants.flatMap(hoodieInstant ->
 
 Review comment:
   What I'm saying is group by only the instants chosen to archive, all types 
of actions is fine..

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to