Skip to content

Commit

Permalink
[MINOR] Only getCompletionTime for completedInstants
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzhaojing committed Dec 9, 2024
1 parent f693bed commit 55e47f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ public static HoodieTimeline getCommitsTimelineAfter(
if (lastMaxCompletionTime.isPresent()) {
// Get 'hollow' instants that have less instant time than exclusiveStartInstantTime but with greater commit completion time
HoodieTimeline hollowInstantsTimeline = ((HoodieTimeline) timeline).getCommitsTimeline()
.filterCompletedInstants()
.filter(s -> compareTimestamps(s.requestedTime(), LESSER_THAN, exclusiveStartInstantTime))
.filter(s -> compareTimestamps(s.getCompletionTime(), GREATER_THAN, lastMaxCompletionTime.get()));
if (!hollowInstantsTimeline.empty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ public void testGetCommitsTimelineAfter() throws IOException {
String startTs = "010";
HoodieTableMetaClient mockMetaClient = prepareMetaClient(
Arrays.asList(
new HoodieInstant(INFLIGHT, COMMIT_ACTION, "008", null, InstantComparatorV2.REQUESTED_TIME_BASED_COMPARATOR),
new HoodieInstant(COMPLETED, COMMIT_ACTION, "009", "013", InstantComparatorV2.REQUESTED_TIME_BASED_COMPARATOR),
new HoodieInstant(COMPLETED, COMMIT_ACTION, "010", "010", InstantComparatorV2.REQUESTED_TIME_BASED_COMPARATOR),
new HoodieInstant(COMPLETED, COMMIT_ACTION, "011", "011", InstantComparatorV2.REQUESTED_TIME_BASED_COMPARATOR),
Expand Down

0 comments on commit 55e47f5

Please sign in to comment.