yongster commented on code in PR #10994:
URL: https://github.com/apache/arrow-rs/pull/10994#discussion_r3950335858
##########
arrow-select/src/take.rs:
##########
@@ -339,6 +339,12 @@ fn take_impl<IndexType: ArrowPrimitiveType, const CHECKED:
bool>(
}
}
DataType::Union(fields, UnionMode::Sparse) => {
+ if indices.null_count() > 0 && fields.iter().any(|(_, field)|
!field.is_nullable()) {
Review Comment:
Good call — that was stricter than dense. 482722605 now matches dense: a
single nullable child is enough to represent a null index. Unselected children
are taken with dummy indices so non-nullable fields do not get introduced nulls.
A sparse union with no nullable child still errors, same as dense.
##########
arrow-select/src/take.rs:
##########
@@ -339,6 +339,12 @@ fn take_impl<IndexType: ArrowPrimitiveType, const CHECKED:
bool>(
}
}
DataType::Union(fields, UnionMode::Sparse) => {
+ if indices.null_count() > 0 && fields.iter().any(|(_, field)|
!field.is_nullable()) {
Review Comment:
Yes, intended. `take` follows the declared field nullability. `UnionBuilder`
marking children as non-nullable after `append_null` is the existing #1637
issue and is out of scope here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]