From 5ac4bc2e798ce75a99df6caa6eb2c6ab5d7cce48 Mon Sep 17 00:00:00 2001 From: Scott Sandre Date: Wed, 4 Dec 2024 08:41:39 -0800 Subject: [PATCH] PR review: update comments --- .../src/main/java/io/delta/kernel/Snapshot.java | 12 ++---------- .../java/io/delta/kernel/internal/SnapshotImpl.java | 9 +++++++++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/kernel/kernel-api/src/main/java/io/delta/kernel/Snapshot.java b/kernel/kernel-api/src/main/java/io/delta/kernel/Snapshot.java index 04f270c3ae8..273889bd119 100644 --- a/kernel/kernel-api/src/main/java/io/delta/kernel/Snapshot.java +++ b/kernel/kernel-api/src/main/java/io/delta/kernel/Snapshot.java @@ -30,8 +30,7 @@ public interface Snapshot { /** - * Get the version of this snapshot in the table. Returns -1 if the table is empty and so has no - * commits. + * Get the version of this snapshot in the table. * * @param engine {@link Engine} instance to use in Delta Kernel. * @return version of this snapshot in the Delta table @@ -50,14 +49,7 @@ public interface Snapshot { List getPartitionColumnNames(Engine engine); /** - * Get the timestamp (in milliseconds since the Unix epoch) of the latest commit of this snapshot. - * Returns -1 if the table is empty and so has no commits. - * - *

When InCommitTimestampTableFeature is enabled, the timestamp is retrieved from the - * CommitInfo of the latest commit which can result in an IO operation. - * - *

For non-ICT tables, this is the same as the file modification time of the latest commit in - * the snapshot. + * Get the timestamp (in milliseconds since the Unix epoch) of the latest commit in this snapshot. * * @param engine the engine to use for IO operations * @return the timestamp of the latest commit diff --git a/kernel/kernel-api/src/main/java/io/delta/kernel/internal/SnapshotImpl.java b/kernel/kernel-api/src/main/java/io/delta/kernel/internal/SnapshotImpl.java index 044f51d83fb..f5c862d403e 100644 --- a/kernel/kernel-api/src/main/java/io/delta/kernel/internal/SnapshotImpl.java +++ b/kernel/kernel-api/src/main/java/io/delta/kernel/internal/SnapshotImpl.java @@ -73,6 +73,15 @@ public long getVersion(Engine engine) { return version; } + /** + * Get the timestamp (in milliseconds since the Unix epoch) of the latest commit in this Snapshot. + * + *

When InCommitTimestampTableFeature is enabled, the timestamp is retrieved from the + * CommitInfo of the latest commit in this Snapshot, which can result in an IO operation. + * + *

For non-ICT tables, this is the same as the file modification time of the latest commit in + * this Snapshot. + */ @Override public long getTimestamp(Engine engine) { if (IN_COMMIT_TIMESTAMPS_ENABLED.fromMetadata(metadata)) {