feat(namespace-dir): implement rename_table for DirectoryNamespace#6961
Open
XuQianJin-Stars wants to merge 1 commit into
Open
feat(namespace-dir): implement rename_table for DirectoryNamespace#6961XuQianJin-Stars wants to merge 1 commit into
XuQianJin-Stars wants to merge 1 commit into
Conversation
Implements the rename_table method for DirectoryNamespace, allowing tables to be renamed within the same namespace. The implementation: - Validates source table exists via resolve_table_location - Checks destination table does not already exist - Copies all files from source to destination path - Removes the source directory after successful copy - Updates manifest entries when manifest mode is enabled - Rejects cross-namespace rename when manifest mode is disabled Includes 5 unit tests: - test_rename_table_basic: basic rename and verify accessibility - test_rename_to_existing_table_should_fail: conflict detection - test_rename_nonexistent_table_should_fail: source not found - test_rename_table_empty_name_should_fail: input validation - test_rename_table_cross_namespace_should_fail: unsupported in dir mode
Contributor
|
ACTION NEEDED The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification. For details on the error please inspect the "PR Title Check" action. |
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.
Closes #6922
Summary
DirectoryNamespace(the filesystem-backedLanceNamespaceimplementation inrust/lance-namespace-impls/src/dir.rs) currently falls back to the trait's default "Not supported" implementation for two DML operations. This PR wires them up to Lance core, on par with whatDataset::update/Dataset::deletealready provide for direct dataset access.update_table(UpdateTableRequest) -> UpdateTableResponselance::dataset::write::UpdateBuilderdelete_from_table(DeleteFromTableRequest) -> DeleteFromTableResponseDataset::delete(predicate)Both methods are already exposed on the Java side (
DirectoryNamespace.javaupdateTable/deleteFromTable) and bylance-namespace-request-client, so this PR is Rust-only and unblocks the existing client surface.Changes
update_tableUpdateBuilderby setting each[column, expression]pair from the request, applies the optionalpredicateviaupdate_where, and returns the actualrows_updatedand the new datasetversion.updateslist up-front (non-empty list, exactly two elements per pair, non-empty / duplicate-free column names) so callers get a cleanInvalidInputinstead of an opaque DataFusion parse error.