feat(datafusion): Add $snapshots system table#264
Merged
JingsongLi merged 3 commits intoapache:mainfrom Apr 25, 2026
Merged
Conversation
773de3c to
f98569e
Compare
JingsongLi
reviewed
Apr 22, 2026
| } | ||
|
|
||
| /// List snapshot files and find the id using the given reducer (min or max). | ||
| async fn find_by_list_files(&self, reducer: fn(i64, i64) -> i64) -> crate::Result<Option<i64>> { |
Member
Author
There was a problem hiding this comment.
The refactor shares the directory-scan logic between the existing find_by_list_files and the new list_all_ids, I will revert it to keep this PR scoped to $snapshots.
luoyuxia
reviewed
Apr 24, 2026
Contributor
luoyuxia
left a comment
There was a problem hiding this comment.
Thanks for the pr. Left minor comments. PTAL
| /// List all snapshot ids sorted ascending. | ||
| pub async fn list_all_ids(&self) -> crate::Result<Vec<i64>> { | ||
| let snapshot_dir = self.snapshot_dir(); | ||
| let statuses = self.file_io.list_status(&snapshot_dir).await?; |
Contributor
There was a problem hiding this comment.
Seems it will return error when the snapshot dir doesn't exists. Is it expected to return error instead of empty vec?
Member
Author
There was a problem hiding this comment.
@luoyuxia Good catch, thanks! Updated to return an empty vec when the
snapshot directory doesn't exist.
0113ca6 to
eef07c9
Compare
luoyuxia
approved these changes
Apr 24, 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
Mirrors Java SnapshotsTable: exposes
<table>$snapshotswith 14 columns matching JavaSnapshotsTable.TABLE_TYPE.