Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Describe the enhancement requested

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.

I think inlining parent validity into child validity is more effective for query engines.

Component(s)

Format

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

Accessing Arrow Struct children requires checking both parent and child validity (p[i] && c[i]), which can feel cumbersome. For example, Java's StructVector.getChild(), needing explicit parent.isNull(i) checks.
I think setting the child's validity bit to null at the format level when the parent is null would reduce burden and overhead for users.

ref:
https://arrow.apache.org/blog/2022/10/08/arrow-parquet-encoding-part-2/

You must be logged in to vote
0 replies
Comment options

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 other arrays would be almost impossible.

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

This might be better to discuss on dev@ mailing but but I'd also add that changing this invariant is non-trivial in terms of versioning. I'm not sure there would be much interest in doing so.

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.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.