yihua commented on code in PR #11947:
URL: https://github.com/apache/hudi/pull/11947#discussion_r1797771592


##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/CompletionTimeQueryView.java:
##########
@@ -223,6 +224,25 @@ public List<String> getStartTimes(
         InstantRange.RangeType.CLOSED_CLOSED, earliestInstantTimeFunc);
   }
 
+  /**
+   * Queries the instant start time with given completion time range.
+   *
+   * @param rangeStart              The query range start completion time.
+   * @param rangeEnd                The query range end completion time.
+   * @param rangeType               The range type.
+   *                                with the minimum completion time.
+   *
+   * @return The sorted instant time list.
+   */
+  @VisibleForTesting
+  public List<String> getStartTimes(
+      String rangeStart,
+      String rangeEnd,
+      RangeType rangeType) {
+    return 
getStartTimes(metaClient.getCommitsTimeline().filterCompletedInstants(), 
Option.ofNullable(rangeStart), Option.ofNullable(rangeEnd),
+        rangeType, s -> HoodieInstantTimeGenerator.instantTimeMinusMillis(s, 
MILLI_SECONDS_IN_ONE_DAY));

Review Comment:
   Could we extract `s -> HoodieInstantTimeGenerator.instantTimeMinusMillis(s, 
MILLI_SECONDS_IN_ONE_DAY)` to a final variable so the assumption is clear?  I 
think this is also copied from another place.



##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/HoodieDefaultTimeline.java:
##########
@@ -532,6 +532,13 @@ public boolean isBeforeTimelineStarts(String instant) {
         && compareTimestamps(instant, LESSER_THAN, 
firstNonSavepointCommit.get().getTimestamp());
   }
 
+  @Override
+  public boolean isBeforeTimelineStartsByCompletionTime(String completionTime) 
{
+    Option<HoodieInstant> firstNonSavepointCommit = 
getFirstNonSavepointCommit();

Review Comment:
   `getFirstNonSavepointCommit()`uses the sorted instants by (start) instant 
time.  Here it needs the instant with the smallest completion time.



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