Skip to content

[Format] Inline parent validity bitmap into child validity bitmap #46086

Answered by felipecrv
takaaki7 asked this question in Q&A
Discussion options

You must be logged in to vote

Currently, when struct itself is null, child field's validity is unknown. So client must compute AND of those bitmaps to know child's validity.

That is a feature, not a bug. The validity bitmap (aka "nulls") is a mask on top of the children arrays. Setting a value to null only requires updating the mask, not recursively traversing the child arrays to set them to null as well.

A similar pattern exists in other nested arrays like List: offsets[i + 1] - offsets[i] is not necessarily zero when the i-th list is null.

Even though it's a bit cumbersome when reading (bitwise AND necessary), preserving this invariant you're proposing on every operation that builds new arrays from scratch or from…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@emkornfield
Comment options

Answer selected by emkornfield
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants
Converted from issue

This discussion was converted from issue #43494 on April 10, 2025 05:32.