feat(catalog): add ListSnapshots() to public Catalog API#244
Merged
lxy-9602 merged 2 commits intoApr 23, 2026
Conversation
709a922 to
75a42c3
Compare
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new public Catalog API to list table snapshots (for time-travel discovery) by introducing a SnapshotInfo metadata struct and implementing ListSnapshots() for FileSystemCatalog.
Changes:
- Added
Catalog::ListSnapshots()pure-virtual API returningstd::vector<SnapshotInfo>. - Introduced public
SnapshotInfo+CommitKindtypes and string conversion helper. - Implemented snapshot listing in
FileSystemCatalogviaSnapshotManager.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/paimon/core/snapshot_info.cpp | Implements CommitKindToString() for the new public enum. |
| include/paimon/snapshot/snapshot_info.h | Adds public SnapshotInfo and CommitKind definitions. |
| include/paimon/catalog/catalog.h | Extends the public Catalog interface with ListSnapshots(). |
| src/paimon/core/catalog/file_system_catalog.h | Declares FileSystemCatalog::ListSnapshots() override. |
| src/paimon/core/catalog/file_system_catalog.cpp | Implements snapshot listing and commit-kind conversion. |
| src/paimon/CMakeLists.txt | Adds new compilation unit for snapshot info support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a3a08da to
4714c2a
Compare
d6eda73 to
93282ed
Compare
Contributor
Author
|
Planning to support time travel in duckdb-paimon, so as a prerequisite, we need to know all the snapshots we currently have. Export it from paimon-cpp. |
lxy-9602
reviewed
Apr 21, 2026
d417ceb to
de7ec9f
Compare
lxy-9602
reviewed
Apr 22, 2026
b201101 to
3d13f66
Compare
Introduce a plain-data SnapshotInfo struct and a scoped CommitKind enum in a new public header include/paimon/snapshot/snapshot_info.h. Both types are fully exported via PAIMON_EXPORT and carry no dependency on internal Jsonizable or RapidJSON headers, keeping the public API surface clean. The struct exposes only user-facing fields: snapshot_id, schema_id, commit_user, commit_kind, time_millis, total_record_count, delta_record_count, and watermark. Internal manifest list paths and commit_identifier are intentionally omitted. Extend the abstract Catalog interface with a new pure-virtual method ListSnapshots(), which returns all snapshots of a table ordered by snapshot id ascending. FileSystemCatalog delegates to the existing SnapshotManager::GetAllSnapshots() and converts each internal Snapshot to a SnapshotInfo through a file-local ConvertCommitKind helper, leaving all internal code untouched. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
3d13f66 to
0012782
Compare
Collaborator
|
+1 |
lucasfang
approved these changes
Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Add ListSnapshots() to the abstract Catalog interface and implement it in FileSystemCatalog. The method returns a vector of SnapshotInfo, a new plain-data struct that exposes user-facing snapshot metadata.
The primary use case is time travel: callers list snapshots to discover available versions, then pass a chosen snapshot_id to the read API.
API and Format
Yes — adds a new pure-virtual method ListSnapshots() to include/paimon/catalog/catalog.h and a new public header include/paimon/snapshot/snapshot_info.h. No storage format or protocol change.
Generative AI tooling
Generated-by: Claude Opus 4.7