andygrove opened a new issue, #112:
URL: https://github.com/apache/datafusion-spark/issues/112

   ### Describe the bug
   
   `collect_list` with an `ORDER BY` inside the call fails with an internal 
error:
   
   ```sql
   SELECT collect_list(a ORDER BY a DESC) FROM (VALUES (3), (1), (2)) t(a);
   -- DataFusion error: Internal error: Assertion failed: values.len() == 1 
(left: 2, right: 1): expects single batch.
   ```
   
   Spark SQL has no `ORDER BY` inside `collect_list`, so there is no Spark 
result to match, but DataFusion's SQL accepts the syntax and an internal error 
is never the right answer.
   
   ### Expected behavior
   
   Either support the ordering (as DataFusion's `array_agg(a ORDER BY ...)` 
does), or reject it at planning time with a clear error. `collect_set` should 
be checked too.
   
   ### Additional context
   
   Found while documenting `collect_list` (#108).
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to