Repository navigation
fix(variant): preserve SQL NULL for missing shredded object fields - #11504
Conversation
cakeni
left a comment
There was a problem hiding this comment.
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 |
|
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. |
|
@shatrughnaupadhyay hopefully #12224 passed the merge queue tonight. You will be able to reuse the nulls preservation from there |
|
@shatrughnaupadhyay we're good to go 🚀 |
|
@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
left a comment
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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:
| // 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 |
|
Thanks again @shatrughnaupadhyay @cakeni 🙏 |
path_nullsand cover nested paths, fallback values, empty objects, and sliced arrays.variant_getreturns Variant null instead of SQL NULL for missing shredded object fields #11191.