voonhous commented on code in PR #19338:
URL: https://github.com/apache/hudi/pull/19338#discussion_r3643762519
##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/versioning/v1/CompletionTimeQueryViewV1.java:
##########
@@ -205,7 +216,39 @@ private List<String> getInstantTimes(
Option<String> rangeEnd,
InstantRange.RangeType rangeType,
Function<String, String> earliestInstantTimeFunc) {
- throw new RuntimeException("Incremental query view for timeline version 1
not yet implemented");
+ final boolean startFromEarliest =
START_COMMIT_EARLIEST.equalsIgnoreCase(rangeStart.orElse(null));
+ HoodieTimeline completedTimeline = timeline.filterCompletedInstants();
Review Comment:
This turns the archived-offset case from a hard failure into a silent skip.
Everything below only sees the active timeline, so if a streaming job was down
long enough for archival to pass its resume offset, the commits between
`rangeStart` and the first active instant just vanish from the read. The V2
view covers that window by lazily loading the archive; the old
`RuntimeException` here at least made the gap loud. (Same story for the `(_,
end]` branch: V2 falls back to the archived map, this returns empty.)
The view already has `isArchived()`, so a cheap guard keeps the fail-stop
semantics:
```java
if (rangeStart.isPresent() && !startFromEarliest &&
isArchived(rangeStart.get())) {
throw new HoodieException("Start instant " + rangeStart.get()
+ " is already archived; incremental read on a LAYOUT_VERSION_1
timeline does not consult the archived timeline");
}
```
Reading the archived timeline would be even better (`analyze()` already
handles archived instants via `getArchivedReadTimeline`), but at minimum a loud
failure beats silent data loss on resume.
--
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]