lancedb/lancedb

Refactor: split up table.rs

Open

#2,949 opened on 2026年1月28日

GitHub で見る
 (6 comments) (1 reaction) (0 assignees)HTML (10,303 stars) (876 forks)batch import
good first issue

説明

This file has over 5k lines.

Can put implementation and tests of individual operations in submodules, like so:

/rust/lancedb/src/table.rs
              .../table/add_data.rs
              .../table/delete.rs
              ...
  • add_data.rs
  • delete.rs
  • update.rs
  • merge_insert.rs
  • schema_evolution.rs (add, drop, alter column)
  • optimize.rs
  • create_index.rs
  • query.rs

We should move the code, but keep the APIs the same. So each of the submodule should be private and we can re-export the members in table.rs.

Improving tests

As we refactor, we should move over the tests, and find opportunities to improve testing. This means both improving the existing tests (often making them more concise) and adding new test coverage.

Improvements for existing tests often include:

  • Switching to memory:// URI so you don't have to create a temporary directory
  • Switch to creating literal data with arrow_array::record_batch!() macro
  • Parameterizing test cases

New test coverage often includes:

  • Covering methods on builders not yet tested
  • Testing common error cases
  • Testing both local and remote database

コントリビューターガイド