Skip to content

fix(variant): preserve SQL NULL for missing shredded object fields - #11504

Merged
sdf-jkl merged 7 commits into
apache:mainfrom
shatrughnaupadhyay:fix/11191-missing-shredded-field
Nov 24, 2026
Merged

sdf-jkl merged 7 commits into
apache:mainfrom
shatrughnaupadhyay:fix/11191-missing-shredded-field

Conversation

@shatrughnaupadhyay

@shatrughnaupadhyay shatrughnaupadhyay commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot added parquet-variant parquet-variant* crates bug Squash those bugs labels Oct 10, 2026

@cakeni cakeni left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I checked missing fields after list indexes as well; shredded and unshredded extraction agree for both SQL NULL and encoded Variant null.

@shatrughnaupadhyay
shatrughnaupadhyay marked this pull request as ready for review October 26, 2026 02:50
@shatrughnaupadhyay

Copy link
Copy Markdown
Contributor Author

Looks good to me. I checked missing fields after list indexes as well; shredded and unshredded extraction agree for both SQL NULL and encoded Variant null.

Thanks

@sdf-jkl

sdf-jkl commented Oct 27, 2026

Copy link
Copy Markdown
Member

Thanks @shatrughnaupadhyay 🙏

I want to merge #11052 first and see if reusing it's approach here would be easier/less code than having a second implementation for missing object fields.

@sdf-jkl

sdf-jkl commented Nov 13, 2026

Copy link
Copy Markdown
Member

@shatrughnaupadhyay hopefully #12224 passed the merge queue tonight. You will be able to reuse the nulls preservation from there

@sdf-jkl

sdf-jkl commented Nov 13, 2026

Copy link
Copy Markdown
Member

@shatrughnaupadhyay we're good to go 🚀

@sdf-jkl

sdf-jkl commented Nov 20, 2026

Copy link
Copy Markdown
Member

@shatrughnaupadhyay 👀

@shatrughnaupadhyay

Copy link
Copy Markdown
Contributor Author

Thanks @sdf-jkl @cakeni I have resolved conflicts, please help with merge.

@sdf-jkl

sdf-jkl commented Nov 23, 2026

Copy link
Copy Markdown
Member

@shatrughnaupadhyay other than the conflicts, could you please enable the CI on your fork and integrate the null preservation introduced in #12224 🙏

@shatrughnaupadhyay

Copy link
Copy Markdown
Contributor Author

@shatrughnaupadhyay other than the conflicts, could you please enable the CI on your fork and integrate the null preservation introduced in #12224 🙏

Thanks @sdf-jkl, integrated CI and it is success now https://github.com/shatrughnaupadhyay/arrow-rs/actions/runs/45098316568

@sdf-jkl sdf-jkl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again @shatrughnaupadhyay two more suggestions

}
accumulated_nulls =
NullBuffer::union(accumulated_nulls.as_ref(), path_nulls.as_ref());
// Typed struct casts retain their existing missing-field semantics.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gate also skips the mask for number and string outputs, and for those the reason is the fast path: an extra mask makes try_perfect_shredding rebuild the array instead of returning typed_value as-is (removing the gate fails the Arc::ptr_eq check in test_perfect_shredding_three_typed_value_columns).

For struct targets the current behavior is the bug in #11301, so I would not describe it as semantics to keep. How about:

Suggested change
// Typed struct casts retain their existing missing-field semantics.
// Typed outputs skip this: a missing field's null `typed_value` already
// yields NULL we can zero-copy

@sdf-jkl sdf-jkl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sdf-jkl
sdf-jkl added this pull request to the merge queue Nov 24, 2026
@sdf-jkl

sdf-jkl commented Nov 24, 2026

Copy link
Copy Markdown
Member

Thanks again @shatrughnaupadhyay @cakeni 🙏

Merged via the queue into apache:main with commit a5fb355 Nov 24, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Squash those bugs parquet-variant parquet-variant* crates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Variant] variant_get returns Variant null instead of SQL NULL for missing shredded object fields

4 participants