alamb opened a new issue, #5454:
URL: https://github.com/apache/arrow-rs/issues/5454
**Describe the bug**
`lexsort_to_indices` a `ListArray` itself works fine
However, `lexsort_to_indices` with a `ListArray` and another array results
in an error:
**To Reproduce**
Here is a reproducer:
```rust
let string_array: ArrayRef = Arc::new(StringArray::from(vec!["a", "b",
"c", "d", "e"]));
let data = vec![
Some(vec![Some(0), Some(1), Some(2)]),
None,
None,
Some(vec![Some(3), None, Some(5)]),
Some(vec![Some(6), Some(7)]),
];
let list_array: ArrayRef =
Arc::new(ListArray::from_iter_primitive::<Int32Type, _, _>(data));
// lex_sort works fine on ListArray
let sort_cols = vec![
SortColumn {
values: list_array.clone(),
options: None,
},
];
arrow::compute::lexsort_to_indices(&sort_cols, None).unwrap();
// but not on list array with string array
let sort_cols = vec![
SortColumn {
values: list_array,
options: None,
},
SortColumn {
values: string_array,
options: None,
},
];
// XXXXX This fails with
// called `Result::unwrap()` on an `Err` value:
InvalidArgumentError("The data type type List(Field { name: \"item\",
data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata:
{} }) has no natural order")
arrow::compute::lexsort_to_indices(&sort_cols, None).unwrap();
```
The test should pass and not error
**Additional context**
Reported by @JasonLi-cn on
https://github.com/apache/arrow-datafusion/pull/9410
--
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]