lance-format / lance-format/lance
feat(namespace-dir): implement rename_table for DirectoryNamespace
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7.1k
- Forks
- 852
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 272
Description
Summary
Implement rename_table for DirectoryNamespace to allow renaming tables within the same namespace at the directory level.
Motivation
The LanceNamespace trait defines a rename_table method, but DirectoryNamespace currently falls back to the default "not implemented" behavior. This blocks use cases where tables need to be renamed in directory-based namespace deployments (e.g., COS / GooseFS connectors).
Requirements
Core Functionality
- Validate input: reject empty
new_table_name - Verify source table exists via
resolve_table_location - Check destination table does not already exist (conflict detection)
- Copy all files from source table directory to destination path
- Remove source directory after successful copy
- Update manifest entries when manifest mode is enabled (drop old + register new)
Cross-Namespace Rename
- Reject cross-namespace rename when manifest mode is disabled (return
Unsupportederror) - Delegate cross-namespace rename to
ManifestNamespacewhen manifest mode is enabled
Error Handling
- Return
InvalidInputfor empty table name - Return
TableNotFoundwhen source table does not exist - Return
TableAlreadyExistswhen destination table already exists - Return
Unsupportedfor cross-namespace rename without manifest - Return
Internalfor filesystem operation failures
Acceptance Criteria
-
rename_tableworks correctly in both manifest-enabled and manifest-disabled modes - All files (manifests, data fragments, indices, etc.) are correctly moved
- Original table is no longer accessible after rename
- Renamed table is fully accessible (describe, query, etc.)
- Unit tests cover: basic rename, conflict detection, source not found, empty name validation, cross-namespace rejection
Related
- Part of the namespace operations roadmap (PR-C in the PR breakdown plan)
- Depends on:
resolve_table_location,table_exists,remove_dir_all
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at DirectoryNamespace's LanceNamespace implementation and trace resolve_table_location, table_exists, and remove_dir_all. Compare ManifestNamespace handling for cross-namespace operations, then add coverage for same-namespace moves, conflicts, missing sources, empty names, and manifest-disabled rejection; done means the destination is accessible and the source is gone.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100