Jefffrey commented on code in PR #10782:
URL: https://github.com/apache/arrow-rs/pull/10782#discussion_r3834987670
##########
arrow-select/src/concat.rs:
##########
@@ -424,6 +424,18 @@ where
.filter(|x| !x.run_ends().is_empty())
.collect();
+ if run_arrays.is_empty() {
+ // Every input was itself a logically-empty run array (e.g. a
+ // zero-length slice of a nested RunEndEncoded field). There is
+ // nothing to concatenate, but the result is still a valid
+ // zero-length array of the same type, not an error: falling
+ // through to `concat(&values_slices)` below would call `concat`
+ // with zero arrays, which cannot be answered because a type-erased
+ // `&[&dyn Array]` with no elements carries no `DataType` to build
+ // the result from.
Review Comment:
```suggestion
// If all input arrays are empty then handle here otherwise we
// lose the type below
```
keep it nice and simple
##########
arrow-select/src/concat.rs:
##########
@@ -1905,6 +1917,29 @@ mod tests {
assert_eq!(expected, actual);
}
+ #[test]
+ fn test_concat_run_array_all_empty() {
+ // Two run arrays that are both logically empty (e.g. zero-length
+ // slices of a nested RunEndEncoded field). `run_arrays` inside
+ // `concat_run_arrays` filters both out, and previously fell through
+ // to `concat(&[])`, which errors because a type-erased empty slice
+ // carries no `DataType` to build a result from.
Review Comment:
```suggestion
```
personally i feel it speaks for itself; its just another edge case we didnt
test before
--
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]