alamb opened a new issue, #2779:
URL: https://github.com/apache/arrow-rs/issues/2779
**Describe the bug**
When operating on an array that was `slice`ed, the result of `min` is
incorrect
```
min([Null, 4.0] --> should be 4.0
```
However,
```
min([Null, Null, Null, Null, Null, Null, 4.0].slice(4,2)) --> should be 4.0
as well but returns None
```
**To Reproduce**
Use this program:
```rust
use arrow::{array::{Float64Array, Array, as_primitive_array},
datatypes::Float64Type};
fn main() {
// behavior of sliced min changed (TODO make a demonstration)
// Input is [None, 4.0], min value should be 4.0
let expected_min = Some(4.0);
let input: Float64Array = vec![None, Some(4.0)].into_iter().collect();
let min = arrow::compute::min(&input);
assert_eq!(min, expected_min);
// however, when sliced the min value is incorrect
let sliced_input: Float64Array = vec![None, None, None, None, None,
Some(4.0)].into_iter().collect();
let sliced_input = sliced_input.slice(4, 2);
let sliced_input = as_primitive_array::<Float64Type>(&sliced_input);
// The array valare are equal
assert_eq!(sliced_input, &input);
// but the minimum is not
let sliced_min = arrow::compute::min(&sliced_input);
assert_eq!(sliced_min, expected_min);
}
```
**Expected behavior**
The example should pass. It passes on arrow `22.0.0` but fails on arrow
`23.0.0` like this:
```
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `None`,
right: `Some(4.0)`', src/main.rs:25:5
stack backtrace:
```
**Additional context**
Found while debugging upgrade in IOx:
https://github.com/influxdata/influxdb_iox/pull/5694
--
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]