lance-format / lance-format/lance

feat(namespace-dir): implement rename_table for DirectoryNamespace

Open
#6,960 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-namespace feature
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 Unsupported error)
  • Delegate cross-namespace rename to ManifestNamespace when manifest mode is enabled
Error Handling
  • Return InvalidInput for empty table name
  • Return TableNotFound when source table does not exist
  • Return TableAlreadyExists when destination table already exists
  • Return Unsupported for cross-namespace rename without manifest
  • Return Internal for filesystem operation failures

Acceptance Criteria

  • rename_table works 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.