ivan-kiselev opened a new issue, #12449:
URL: https://github.com/apache/arrow-rs/issues/12449
### Describe the bug
Comparison kernels in `arrow-ord` panic with `attempt to subtract with
overflow` when a `RunArray` is sliced to length 0 at an offset past its first
run.
`RunEndBuffer::get_start_physical_index` returns 0 for an empty slice, so
`expand_from_runs` and `ree_physical_indices` start at run 0, whose end is
below the offset.
### To Reproduce
```rust
let a = RunArray::try_new(&Int32Array::from(vec![1, 2]),
&StringArray::from(vec!["a", "b"]))
.unwrap()
.slice(2, 0);
eq(&a, &Scalar::new(StringArray::from(vec!["a"]))).unwrap();
```
### Expected behavior
An empty `BooleanArray`.
### Additional context
Found with property tests. The code came from #9621.
### Willingness to contribute
I plan to contribute a fix for this bug independently
--
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]