fix: propagate validity in Sparse utf8/binary (VarBin) columns (#232)#236
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vortex.sparseover utf8/binary values now carries the same row validity as the primitive path.fill_value: nullstring column nulls every unpatched position (was: empty string).ValidityVTable<Sparse>is generic over the values encoding — VarBin uses the identicalLazySparseBoolArrayrow 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 utf8SparseEncodingDecoderTest#utf8NonNullFill_withNullPatch_nullsOnlyThatPatch— null patch valueSparseEncodingDecoderTest#utf8NonNullFill_validPatches_returnsPlainArray— regression guardCloses #232.
🤖 Generated with Claude Code