danny0405 commented on code in PR #20394:
URL: https://github.com/apache/hudi/pull/20394#discussion_r4332598690


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/timeline/LegacyArchivedMetaEntryReader.java:
##########
@@ -184,6 +185,20 @@ public void close() {
 
         @Override
         public boolean hasNext() {
+          List<Pair<HoodieInstant, Option<byte[]>>> instantAndDetails = 
readNextInstantGroup();
+          // Legacy archives can hold instants that never completed (e.g. a 
requested-only commit); they are not part of the timeline.
+          while (!instantAndDetails.isEmpty() && 
instantAndDetails.stream().noneMatch(instantAndDetail -> 
instantAndDetail.getKey().isCompleted())) {

Review Comment:
   instead of adding then filtering, can we not add/return the instant in the 
very first place.



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