Skip to content

Commit

Permalink
update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
huan233usc committed Jan 22, 2025
1 parent 1994b2e commit ddc0815
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ public CloseableIterator<FilteredColumnarBatch> getAddFilesAsColumnarBatches(
protected Tuple2<Protocol, Metadata> loadTableProtocolAndMetadata(
Engine engine, Optional<SnapshotHint> snapshotHint, long snapshotVersion) {

// Exit early if the hint already has the info we need
// If the snapshot hint is provided and matches the expected version, load the P&M from version hint.
// If not, e.g. for the case of time travel, skip use version hint and fallback to CRC file or log replay.
if (snapshotHint.isPresent() && snapshotHint.get().getVersion() == snapshotVersion) {
return new Tuple2<>(snapshotHint.get().getProtocol(), snapshotHint.get().getMetadata());
}
Expand All @@ -224,6 +225,7 @@ protected Tuple2<Protocol, Metadata> loadTableProtocolAndMetadata(
// for. We need to replay the actions to get the latest protocol and metadata, but
// update the hint to read the actions from the version we found to check if the
// protocol and metadata are updated in the versions after the one we found.
// Building a new snapshotHit for determining the time to end the log replay loop.
snapshotHint =
Optional.of(
new SnapshotHint(crcInfo.getVersion(), crcInfo.getProtocol(), crcInfo.getMetadata()));
Expand Down

0 comments on commit ddc0815

Please sign in to comment.