Skip to content

fix(blob): compact struct-nested blob v2 columns - #8083

Draft
wjones127 wants to merge 1 commit into
lance-format:mainfrom
wjones127:fix/nested-blob-v2-compaction
Draft

fix(blob): compact struct-nested blob v2 columns#8083
wjones127 wants to merge 1 commit into
lance-format:mainfrom
wjones127:fix/nested-blob-v2-compaction

Conversation

@wjones127

Copy link
Copy Markdown
Contributor

Compaction rewrites blob v2 columns from their stored descriptor form back into the writer's user view, but it only did so for columns at the top level of the schema. A blob v2 field nested inside a struct — e.g. struct<mime: string, payload: blob> — was passed through untouched, so the writer received a descriptor struct where it expected a payload and every fragment rewrite failed with "Blob struct missing data field". The dataset was still readable, but permanently un-compactable: it could never reclaim space from deleted rows or merge small fragments.

This PR walks struct children when rewriting a batch, and when building the transformed stream schema, addressing each blob leaf by its dotted path so its payloads are read back correctly.

Fixes #8082

Not included

Blob v2 nested under a list is still not supported by compaction: payloads are addressed one per row, and a list holds many values per row. That case previously hit the same misleading "missing data field" error and now reports NotSupported with an explanation instead.

Compaction converted blob v2 descriptor columns back into the writer's
user view only for top-level columns. A blob v2 field nested inside a
struct was passed through as a descriptor struct, so any fragment rewrite
failed with "Blob struct missing `data` field" and the dataset could never
be compacted.

Walk struct children when rewriting a batch (and when building the
transformed stream schema), addressing each blob leaf by its dotted path.
Blob v2 under a list is still unsupported, but now reports NotSupported
instead of the misleading descriptor error.

Fixes lance-format#8082

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the bug Something isn't working label Jul 29, 2026
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.92388% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
rust/lance/src/dataset/optimize.rs 97.92% 1 Missing and 5 partials ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: struct-nested blob v2 column cannot be compacted — "Blob struct missing data field" on any fragment rewrite

1 participant