You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In looking into apache/datafusion#4828, I came across what I think is an issue with the take kernel when operating on List arrays. It seems that when a taken element of the list array is an empty list, the value becomes null in the result of take.
I think this is a bug, but let me know if it's the intended behavior.
To Reproduce
Here is an example that stats with the list array: [[0], [], [1]] and takes elements [0, 1, 2].
use arrow::array::{Int32Array,Int32Builder,ListBuilder};use arrow::compute::take;#[test]fntest_take(){letmut val_builder = Int32Builder::new();letmut list_builder = ListBuilder::new(val_builder);
list_builder.values().append_value(0);
list_builder.append(true);
list_builder.append(true);
list_builder.values().append_value(1);
list_builder.append(true);let list = list_builder.finish();println!("list: {:?}", list);let indices = Int32Array::from(vec![0,1,2]);let taken = take(&list,&indices,None).unwrap();println!("taken: {:?}", taken);}
Describe the bug
In looking into apache/datafusion#4828, I came across what I think is an issue with the
take
kernel when operating on List arrays. It seems that when a taken element of the list array is an empty list, the value becomesnull
in the result of take.I think this is a bug, but let me know if it's the intended behavior.
To Reproduce
Here is an example that stats with the list array:
[[0], [], [1]]
and takes elements[0, 1, 2]
.output
Expected behavior
I would expect the result to be the same as the input (
[[0], [], [1]]
), but instead the result is[[0], null, [1]
.Additional context
It looks like this behavior is the result of
arrow-rs/arrow-select/src/take.rs
Lines 706 to 710 in 2d2d0a3
The text was updated successfully, but these errors were encountered: