You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
Tracking issue: #7882
A union has no independent parent validity. A row is null when its
selected child is null, so the union's logical nullability is determined
by its variants.
Storing the same information on `DType::Union` created two sources of
truth and allowed the outer value to disagree with the variants. This
change makes inconsistent union DTypes impossible.
The remaining question is how an operation such as `mask` should change
a union's variants when it introduces nulls. That remains deferred and
does not block the canonical sparse `UnionArray`.
The Arrow implementation notes and deferred operation scope are in [this
comment on
#7882](#7882 (comment)).
## Changes
- change `DType::Union` to store only `UnionVariants`
- derive union nullability at runtime from the variant DTypes
- name the non-zero-cost scan `derived_nullability`
- leave `with_nullability` unchanged for unions instead of rewriting
variant schemas
- restrict union least-supertype coercion to identical variants for now
- remove Union nullability from Serde, protobuf, and FlatBuffers
Supersedes #8713.
---------
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
0 commit comments