Skip to content

fix: propagate validity in Sparse utf8/binary (VarBin) columns (#232)#236

Merged
dfa1 merged 1 commit into
mainfrom
fix/232-varbin-sparse-validity
Jul 8, 2026
Merged

fix: propagate validity in Sparse utf8/binary (VarBin) columns (#232)#236
dfa1 merged 1 commit into
mainfrom
fix/232-varbin-sparse-validity

Conversation

@dfa1

@dfa1 dfa1 commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • vortex.sparse over utf8/binary values now carries the same row validity as the primitive path.
  • A fill_value: null string column nulls every unpatched position (was: empty string).
  • A nullable patch value nulls its own position (was: raw bytes surfaced).
  • The Rust ValidityVTable<Sparse> is generic over the values encoding — VarBin uses the identical LazySparseBoolArray row validity, completing the SparseEncodingDecoder drops nullability — null fill coerced to 0, nullable patch values stripped #226 fix for string/binary columns.

Test plan

  • SparseEncodingDecoderTest#utf8NullFill_nullsUnpatchedPositions_keepsPatchesValid — null-fill utf8
  • SparseEncodingDecoderTest#utf8NonNullFill_withNullPatch_nullsOnlyThatPatch — null patch value
  • SparseEncodingDecoderTest#utf8NonNullFill_validPatches_returnsPlainArray — regression guard

Closes #232.

🤖 Generated with Claude Code

The same null-loss that #226 fixed for primitive Sparse arrays also hit
utf8/binary: decodeVarBin decoded indices via decodeChildSegment (losing the
MaskedArray wrapper) and discarded the patch-values' validity mask. Since the
Rust ValidityVTable<Sparse> is generic over the values encoding, VarBin must
carry the same LazySparseBoolArray row validity.

- Move the fill-scalar decode before the dtype branch so fillValid is in scope.
- Decode indices as decodeChild (preserving MaskedArray); unwrap to idxData.
- Unwrap patch values, capturing patchValidity when it is a MaskedArray.
- Use ctx.materialize(idxData) to obtain the raw index segment.
- Call withSparseValidity on the result, exactly as the primitive path does.
- Add three unit tests: null-fill utf8, non-null fill + null patch, all-valid
  regression guard.
- Add isNullScalar drift-guard comment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dfa1 dfa1 merged commit 43a4deb into main Jul 8, 2026
0 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sparse VarBin/Utf8 columns drop null-fill validity (decodeVarBin)

1 participant