kawadakk opened a new issue, #8533:
URL: https://github.com/apache/arrow-rs/issues/8533
**Describe the bug**
`arrow::compute::interleave` returns an error after arrow-rs 56.0.0 if a
struct array with no fields is provided.
**To Reproduce**
Add the following code to `arrow-select/src/interleave.rs`:
```rust
#[test]
fn test_struct_no_fields() {
let fields = Fields::empty();
let a = StructArray::try_new_with_length(fields.clone(), vec![], None,
10).unwrap();
let v = interleave(&[&a], &[(0, 0)]).unwrap();
assert_eq!(v.len(), 1);
assert_eq!(v.data_type(), &DataType::Struct(fields));
}
```
```text
thread 'interleave::tests::test_struct_no_fields' panicked at
arrow-select/src/interleave.rs:744:46:
called `Result::unwrap()` on an `Err` value: InvalidArgumentError("use
StructArray::try_new_with_length or StructArray::new_empty_fields to create a
struct array with no fields so that the length can be set correctly")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
interleave::tests::test_struct_no_fields
```
**Expected behavior**
Not panicking
**Additional context**
<!--
Add any other context about the problem 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]