Skip to content

feat: add column slice stitching - #8660

Merged
Xuanwo merged 3 commits into
mainfrom
xuanwo/column-slice-stitching
Aug 31, 2026
Merged

feat: add column slice stitching#8660
Xuanwo merged 3 commits into
mainfrom
xuanwo/column-slice-stitching

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Aug 20, 2026

Copy link
Copy Markdown
Member

This implements the Rust storage-layer artifact stitching proposed in Discussion #8615. Long-running fragment-local rewrites can stage immutable physical row slices and publish only after exact, gap-free coverage has been validated against the fragment snapshot.

Compatible current-version files are concatenated by relocating encoded pages and regenerating metadata and the footer, while unsupported layouts use the existing ordered decode/re-encode fallback. Binary-copy compaction now delegates encoded-file compatibility and footer handling to the same primitive without adopting the column-slice lifecycle.

The public surface in this PR is intentionally Rust-only. Python and Java bindings are deferred until the contract has settled.

@github-actions github-actions Bot added A-encoding Encoding, IO, file reader/writer enhancement New feature or request labels Aug 20, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-changes Latest Gatekeeper recommendation requests changes. label Aug 20, 2026
@lance-gatekeeper lance-gatekeeper Bot removed the K-changes Latest Gatekeeper recommendation requests changes. label Aug 20, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gate recommendation: approve.

The revision closes the schema-metadata loss path across V2.0–V2.3 and restores stable row-ID loading for readers that add _rowid after opening. The encoded stitching path now preserves the relevant schema and row-identity contracts.

@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. and removed K-approved Latest Gatekeeper recommendation permits acceptance. labels Aug 20, 2026
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

data_file,
))
}
lance_file::concat::FileConcatResult::Unsupported(_) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think we should do a full blob rewrite during column-slice concatenation. In this mode, workers should write each managed blob payload once into its final sidecar form—packed or dedicated depending on the blob size—and concatenation should stitch only the descriptors and references.

As written, every Lance-managed blob is read back and written again during concatenation. This adds a full extra I/O pass and loses much of the benefit of distributed slice writing. The initial layout does not need to remain optimal forever; a later compaction can re-evaluate and rewrite the blob layout if necessary.

What do you think about making independently referenceable packed and dedicated objects part of the ColumnSlice contract so concatenation never needs to touch the payload bytes?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'm planning to impelment blob reuse index. After that, we could avoid rewriting blobs everytime.

@jackye1995 jackye1995 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approving pending further optimization

@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Aug 31, 2026
@Xuanwo
Xuanwo merged commit b1fc993 into main Aug 31, 2026
35 of 37 checks passed
@Xuanwo
Xuanwo deleted the xuanwo/column-slice-stitching branch August 31, 2026 09:30
Xuanwo added a commit that referenced this pull request Sep 2, 2026
## Problem

Callers need to encode independent row ranges once and assemble them in
caller-supplied order without decoding and re-encoding. Lance should
provide encoded-part validation and final ordinary data-file
construction while leaving part storage and orchestration to the caller.

## Behavior

DataFileTarget is a runtime-only value for one live assembly operation.
It creates the same canonical random file name used by ordinary Lance
writes without creating, reserving, or registering an object. Lance does
not serialize or restore this value and does not define coordinator
restart or cross-process recovery semantics.

Each DataFilePart is a runtime view of an ordinary, complete Lance file.
Callers choose part paths and order, retain the live target for the
operation, and own part storage, cleanup, and commit fencing.

Blob v2 writers receive disjoint ID leases and write managed payloads
directly beneath the sidecar directory selected by the final target.
BlobTargetId only rejects mixing parts assigned to different final
targets within one assembly operation. It is not a dataset, base, or
object-store identity. The caller must use the same dataset and resolved
base for every part write and final assembly.

## Format and ownership

No new Lance file, manifest, transaction, target, or part format is
introduced. The completed output is an ordinary DataFile committed
through the existing transaction path; readers cannot distinguish it
from a normally written file. The implementation uses the current file
format and existing encoded page-relocation machinery.

Callers own target lifetime, part storage, dataset/base association,
cleanup, and commit fencing. Lance owns target name generation, part
encoding and intrinsic validation, runtime target-identity checks, and
final data-file construction.

Follow-up to #8660 and Discussion #8615.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-encoding Encoding, IO, file reader/writer enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants