Describe the bug
#[test]
fn test_take_slice_string() {
let strings =
StringArray::from(vec![Some("hello"), None, Some("world"), None, Some("hi")]);
let indices = Int32Array::from(vec![Some(0), Some(1), None, Some(0), Some(2)]);
let indices_slice = indices.slice(1, 4);
let indices_slice = indices_slice
.as_ref()
.as_any()
.downcast_ref::<Int32Array>()
.unwrap();
let expected = StringArray::from(vec![None, None, Some("hello"), Some("world")]);
let result = take(&strings, indices_slice, None).unwrap();
assert_eq!(result.as_ref(), &expected);
}
thread 'compute::kernels::take::tests::test_take_slice_string' panicked at 'assertion failed: `(left == right)`
left: `StringArray
[
null,
null,
null,
"world",
]`,
right: `StringArray
[
null,
null,
"hello",
"world",
]`', arrow/src/compute/kernels/take.rs:1950:9
To Reproduce
See test. It looks like the null bits aren't being properly shifted when used in the take kernel.
Expected behavior
Test passes.
Additional context
Add any other context about the problem here.
Describe the bug
To Reproduce
See test. It looks like the null bits aren't being properly shifted when used in the take kernel.
Expected behavior
Test passes.
Additional context
Add any other context about the problem here.