lance-format / lance-format/lance
Refactor merge logic to use one abstruct
Open
@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_partitionsmethod; - for the distributed: we implement via
init_writer_for_flat/pq/sqfor different vector index type;
- for the single machine, it is initialized in the
- 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
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.
Assessment
This issue has not been assessed yet.