Skip to content

test(blob): cover mixed-nullability batches in one write - #8081

Closed
wjones127 wants to merge 1 commit into
lance-format:mainfrom
wjones127:test/blob-mixed-nullability-write
Closed

test(blob): cover mixed-nullability batches in one write#8081
wjones127 wants to merge 1 commit into
lance-format:mainfrom
wjones127:test/blob-mixed-nullability-write

Conversation

@wjones127

Copy link
Copy Markdown
Contributor

A blob page records a single interpretation of its definition levels, and the encoder takes that interpretation from whichever batch it happened to see first. Because the interpretation is derived from the batch's validity bitmap rather than the schema, a null-free batch and a batch containing a null disagree — so one write could panic in debug builds and silently turn a null into an empty value in release builds. #8070 fixed that by closing the pending descriptor page whenever the interpretation changes.

That fix is covered by an encoder-level Rust test and, at the dataset level, only from Python via compaction. This adds a Rust regression test that writes a nullable blob column whose batches disagree about nullability, in both orders, and asserts every value and the null survive the round trip.

Verified the test fails on e4288373a (before #8070) and passes on main.

Closes #8077, which was filed against e4288373a and is already fixed on main.

The blob encoder derives each page's definition interpretation from the
validity bitmap of the batch it saw, so a single write whose batches
disagree about nullability used to panic in debug builds and lose the
nulls in release builds. lance-format#8070 fixed this by closing the pending
descriptor page whenever the interpretation changes, but the Rust
coverage stops at the encoder; the dataset write path is only covered
from Python, via compaction.

This adds a `Dataset::write` regression test for a nullable blob column
whose batches disagree, in both orders.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@wjones127 wjones127 closed this Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: blob encoder panics when batches in one write disagree on nullability

1 participant