alamb opened a new issue, #9418:
URL: https://github.com/apache/arrow-datafusion/issues/9418

   ### Is your feature request related to a problem or challenge?
   
   As we have added support for Lists, one thing that is not yet supported is 
multi-column sorts if one of the columns is a list
   
   For example if you run such a query today, you get: "The data type type List 
,,, has no natural order"
   
   ```sql
   ❯ create table foo as values (1, [1,2,3]), (2, [2,3,4]);
   0 rows in set. Query took 0.039 seconds.
   
   ❯ select * from foo;
   +---------+-----------+
   | column1 | column2   |
   +---------+-----------+
   | 1       | [1, 2, 3] |
   | 2       | [2, 3, 4] |
   +---------+-----------+
   2 rows in set. Query took 0.007 seconds.
   
   ❯ select * from foo ORDER BY column1, column2;
   Arrow error: Invalid argument error: The data type type List(Field { name: 
"item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, 
metadata: {} }) has no natural order
   ```
   
   A single column sort does seem to work 
   ```
   ❯ select * from foo ORDER BY column2;
   +---------+-----------+
   | column1 | column2   |
   +---------+-----------+
   | 1       | [1, 2, 3] |
   | 2       | [2, 3, 4] |
   +---------+-----------+
   2 rows in set. Query took 0.005 seconds.
   ```
   
   
   ### Describe the solution you'd like
   
   I would like 
   ```
   
   ❯ select * from foo ORDER BY column1, column2;
   Arrow error: Invalid argument error: The data type type List(Field { name: 
"item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, 
metadata: {} }) has no natural order
   ```
   
   To work
   
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   _No response_


-- 
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]

Reply via email to