lance-format / lance-format/lance

Refactor merge logic to use one abstruct

Open
#5,622 0 comments 0 reactions 1 assignee View on GitHub

@yanghua is already working on this.

Since Jan 4, 2026.

chore
Dominant language
Rust
Stars
7.1k
Forks
852
Avg merge
3d 18h
Merged PRs (30d)
272

Description

To track this issue: https://github.com/lance-format/lance/pull/5117#issuecomment-3698850002

cpoied here:

  • The partition sources of the single-machine and the distributed mode are different:
    • for the single machine: the data comes from the memory;
    • for distributed: the data is persisted into the storage;
  • About the file writer initatization they are also different:
    • for the single machine, it is initialized in the merge_partitions method;
    • for the distributed: we implement via init_writer_for_flat/pq/sq for different vector index type;
  • About the logic of the merger, they are also different due to different partition data sources.

For different partition sources, it would be better to abstract a PartitionSource trait. After that, we can introduce a UnifiedPartitionMerger to do a general merger. Introducing a StorageWriterFactory to create different writers.

For a merger, the generic logic can be split into four common steps:

  • create merger;
  • instantiate merger;
  • merger#merge();
  • write final metadata;

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.