Remove stored Union Nullability#8714
Conversation
| names: [string]; | ||
| dtypes: [DType]; | ||
| type_ids: [byte]; // length must equal dtypes.len() |
There was a problem hiding this comment.
should be fine to break this since nobody is using this yet
f721143 to
30b2a25
Compare
| FixedSizeList(edt, size, _) => FixedSizeList(Arc::clone(edt), *size, nullability), | ||
| Struct(sf, _) => Struct(sf.clone(), nullability), | ||
| Union(vs, _) => Union(vs.clone(), nullability), | ||
| Union(vs) => Union(vs.clone()), |
There was a problem hiding this comment.
So with_nullability now does nothing for Union. I think this is the correct semantics since it is similar for struct where it will not change child nullabilities?
|
Is there a way to override the flatc check here? Edit: making changes |
30b2a25 to
d94c1ee
Compare
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Union Nullability
d94c1ee to
5d215b5
Compare
| if: >- | ||
| github.event_name != 'pull_request' | ||
| || !contains(github.event.pull_request.labels.*.name, 'changelog/break') |
5d215b5 to
f535f8d
Compare
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
f535f8d to
e6e8eeb
Compare
|
poke |
Merging this PR will not alter performance
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
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::Unioncreated 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
maskshould change a union's variants when it introduces nulls. That remains deferred and does not block the canonical sparseUnionArray.The Arrow implementation notes and deferred operation scope are in this comment on #7882.
Changes
DType::Unionto store onlyUnionVariantsderived_nullabilitywith_nullabilityunchanged for unions instead of rewriting variant schemasSupersedes #8713.