Skip to content

fix(merge_insert): reject partial list updates before committing - #11329

Open
lance-gatefixer[bot] wants to merge 2 commits into
mainfrom
gatekeeper/fix-11327-1
Open

lance-gatefixer[bot] wants to merge 2 commits into
mainfrom
gatekeeper/fix-11327-1

Conversation

@lance-gatefixer

@lance-gatefixer lance-gatefixer Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #11327.

Partial list<struct> merge sources could write some item fields to a new file while leaving others in the original file. Changes to list length or nullness then left incompatible list structures in the committed fragment, causing read panics or incorrect values.

Reject partial list item schemas before planning an upsert, naming the field and asking for all item fields. This selects option 3 from the issue: even same-length and all-null partial list sources are rejected. Callers can still omit other table columns when supplying a complete list value. The check also covers large, nested, and fixed-size lists and respects field order, nullability, and existing blob schema conversion rules.

The reader now returns an Arrow error for mismatched list offsets instead of panicking. Existing placeholder merging behavior is preserved.

Nested subset tests cover indexed-only and mixed indexed/unindexed fragments using partial struct sources, preserving the unsupplied timestamp. An upstream HNSW test initializer supplies its required default graph scoring mode so the test targets compile.

Validation after merging main at 6336d0408 (Rust 1.98.1):

  • cargo test -p lance --lib dataset::write::merge_insert::tests::: 444 passed, including multi-fragment partial/full list sources, null/empty transitions, nested list types, indexed joins, and both write modes. Rejected updates leave the dataset version and rows unchanged.
  • cargo test -p lance-arrow: 361 unit tests and 9 doctests passed. The new offset-mismatch cases reproduced the original panic before the fix.
  • cargo test -p lance --lib test_hnsw_prefix_graph_loads_without_dropped_rows: passed.
  • cargo fmt --all and cargo clippy --all --tests --benches -- -D warnings: passed.

Change walkthrough

flowchart LR
    A[Source schema] --> B{Complete list items?}
    B -->|No| C[Return input error]
    B -->|Yes| D[Plan merge]
    D --> E[Write fragments]
    E --> F[Commit transaction]
Loading

Read: Validate before planning → Require complete lists → Return reader errors.

Snapshot: c4e81f2

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@github-actions github-actions Bot added the bug Something isn't working label Nov 20, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 20, 2026
@lance-gatefixer

Copy link
Copy Markdown
Contributor Author

Added and verified the breaking-change label for the rejection of partial list item schemas. No code change was needed.

Preserve the nested projection fix for mixed indexed and unindexed fragments using supported partial struct sources, while retaining partial list rejection coverage. Initialize the default graph scoring mode in the upstream HNSW test so the test targets compile.
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 23, 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.

Rejecting partial list item schemas before planning remains a sound fix for #11327 without relying on per-row length or null checks. The merge preserves #11314’s projection fix for supported partial struct updates.

The earlier follow-up is complete; no further changes are requested.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 23, 2026

This branch has not been deployed

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

Labels

breaking-change bug Something isn't working K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: merge_insert partial update of a list<struct> column that changes a row's list length commits, then every read of the fragment panics

0 participants