You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2024/03/02 11:57:12 UTC

[I] Error `The data type type List .. has no natural order` when using `arrow::compute::lexsort_to_indices` with list and more than one column [arrow-rs]

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: github-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Error `The data type type List .. has no natural order` when using `arrow::compute::lexsort_to_indices` with list and more than one column [arrow-rs]

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold closed issue #5454: Error `The data type type List .. has no natural order` when using `arrow::compute::lexsort_to_indices` with list and more than one column
URL: https://github.com/apache/arrow-rs/issues/5454


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Error `The data type type List .. has no natural order` when using `arrow::compute::lexsort_to_indices` with list and more than one column [arrow-rs]

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on issue #5454:
URL: https://github.com/apache/arrow-rs/issues/5454#issuecomment-1998863479

   `label_issue.py` automatically added labels {'arrow'} from #5455


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org