nsivabalan commented on code in PR #20273:
URL: https://github.com/apache/hudi/pull/20273#discussion_r4263875623


##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/IncrementalQueryAnalyzer.java:
##########
@@ -216,14 +218,11 @@ public QueryContext analyze() {
    * Splits the given instant time list into a pair of archived instant list 
and active instant list.
    */
   private static Pair<List<String>, List<String>> 
splitInstantByActiveness(List<String> instantTimeList, CompletionTimeQueryView 
completionTimeQueryView) {
-    int firstActiveIdx = IntStream.range(0, instantTimeList.size()).filter(i 
-> 
!completionTimeQueryView.isArchived(instantTimeList.get(i))).findFirst().orElse(-1);
-    if (firstActiveIdx == -1) {
-      return Pair.of(instantTimeList, Collections.emptyList());
-    } else if (firstActiveIdx == 0) {
-      return Pair.of(Collections.emptyList(), instantTimeList);
-    } else {
-      return Pair.of(instantTimeList.subList(0, firstActiveIdx), 
instantTimeList.subList(firstActiveIdx, instantTimeList.size()));
-    }
+    // with archival beyond savepoint, a savepointed commit stays active while 
the commits after it are archived,
+    // so the archived instants are not always a prefix of the list: check 
each instant on its own.
+    Map<Boolean, List<String>> instantTimesByArchived = 
instantTimeList.stream()

Review Comment:
   can we take a much simpler route for oob users (archival beyond saveppoint 
disabled). 



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