kawadakk opened a new issue, #4578:
URL: https://github.com/apache/arrow-rs/issues/4578
**Describe the bug**
`arrow::compute::concat` panics when called with dense union arrays with
type IDs that don't start at zero.
```
thread 'proptest::tests::qc_row' panicked at 'index out of bounds: the len
is 1 but the index is 35',
...\.cargo\registry\src\index.crates.io-6f17d22bba15001f\arrow-data-43.0.0\src\transform\union.rs:53:39
stack backtrace:
...
3:
arrow_data::transform::union::build_extend_dense::{{closure}}::{{closure}}
4: core::iter::traits::iterator::Iterator::for_each::call::{{closure}}
at
/rustc/864bdf7843e1ceabc824ed86d97006acad6af643\library\core\src\iter\traits/iterator.rs:853:29
5: core::iter::traits::iterator::Iterator::fold
at
/rustc/864bdf7843e1ceabc824ed86d97006acad6af643\library\core\src\iter\traits/iterator.rs:2481:21
6: core::iter::traits::iterator::Iterator::for_each
at
/rustc/864bdf7843e1ceabc824ed86d97006acad6af643\library\core\src\iter\traits/iterator.rs:856:9
7: arrow_data::transform::union::build_extend_dense::{{closure}}
at
...\.cargo\registry\src\index.crates.io-6f17d22bba15001f\arrow-data-43.0.0\src\transform\union.rs:50:13
8: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
at
/rustc/864bdf7843e1ceabc824ed86d97006acad6af643\library\alloc\src/boxed.rs:2021:9
9: arrow_data::transform::MutableArrayData::extend
at
...\.cargo\registry\src\index.crates.io-6f17d22bba15001f\arrow-data-43.0.0\src\transform\mod.rs:631:9
10: arrow_select::concat::concat
at
...\.cargo\registry\src\index.crates.io-6f17d22bba15001f\arrow-select-43.0.0\src\concat.rs:89:9
```
**To Reproduce**
Call `arrow::compute::concat` and pass the following arrays:
[
UnionArray(Dense)
[
-- type id buffer:
ScalarBuffer([35])
-- offsets buffer:
ScalarBuffer([0])
-- child 35: "" (Null)
NullArray(1)
],
UnionArray(Dense)
[
-- type id buffer:
ScalarBuffer([35])
-- offsets buffer:
ScalarBuffer([0])
-- child 35: "" (Null)
NullArray(1)
],
]
of the following data type:
```
Union(
[
(
35,
Field {
name: "",
data_type: Null,
nullable: false,
dict_id: 0,
dict_is_ordered: false,
metadata: {},
},
),
],
Dense,
)
```
**Expected behavior**
Producing the following array:
```
UnionArray(Dense)
[
-- type id buffer:
ScalarBuffer([35, 35])
-- offsets buffer:
ScalarBuffer([0, 1])
-- child 35: "" (Null)
NullArray(2)
]
```
**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]