feat(namespace-dir): implement table tag operations#6886
Open
XuQianJin-Stars wants to merge 1 commit into
Open
feat(namespace-dir): implement table tag operations#6886XuQianJin-Stars wants to merge 1 commit into
XuQianJin-Stars wants to merge 1 commit into
Conversation
Implement the 5 table tag trait methods on DirectoryNamespace by delegating to the native lance Dataset::tags() interface: - list_table_tags - get_table_tag_version - create_table_tag - delete_table_tag - update_table_tag A small helper map_tag_error translates lance-core ref errors (RefNotFound / RefConflict / InvalidRef / VersionNotFound) into the proper NamespaceError variants (TableTagNotFound, TableTagAlreadyExists, InvalidInput, TableVersionNotFound). Empty tag names and non-positive versions are rejected up-front as InvalidInput. Add 10 unit tests covering create/list, conflict, get, get-not-found, update, update-not-found, delete, delete-not-found, invalid arguments and table-not-found paths.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Summary
Implement the 5 table tag trait methods on
DirectoryNamespaceby delegating to the native lanceDataset::tags()interface, so that tag management works end-to-end against any directory-backed namespace (local FS / object store) without requiring a remote catalog.Closes #6885.
What's Changed
Implemented the following
TableTagtrait methods onDirectoryNamespace(rust/lance-namespace-impls/src/dir.rs):list_table_tags— list all tags of a table, with their referenced version and an optional message.get_table_tag_version— resolve a tag name to its dataset version.create_table_tag— create a new tag pointing to a given version; rejects duplicates.delete_table_tag— delete an existing tag; rejects unknown tags.update_table_tag— move an existing tag to a new version; rejects unknown tags / versions.All methods open the target dataset via the existing directory-resolution logic and then call into
Dataset::tags()(create/update/delete/list/get_version).Error Mapping
A small helper
map_tag_errortranslateslance-coreref errors into the properNamespaceErrorvariants used by the namespace API:RefNotFoundTableTagNotFoundRefConflictTableTagAlreadyExistsInvalidRefInvalidInputVersionNotFoundTableVersionNotFoundAdditionally, requests are validated up-front:
InvalidInput.<= 0) oncreate/update→InvalidInput.TableNotFoundvia the existing dataset-open path.Tests
Added 10 unit tests in
dir.rscovering:create+listhappy path (tag visible with correct version & optional message).createconflict on duplicate tag →TableTagAlreadyExists.get_table_tag_versionhappy path.get_table_tag_versionon unknown tag →TableTagNotFound.update_table_taghappy path (version moves forward).update_table_tagon unknown tag →TableTagNotFound.delete_table_taghappy path (subsequentgetfails).delete_table_tagon unknown tag →TableTagNotFound.InvalidInput.TableNotFound.Scope / Non-Goals
DirectoryNamespaceis touched; other namespace implementations are unchanged.Dataset::tags()API through the directory namespace.