You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "viirya (via GitHub)" <gi...@apache.org> on 2023/05/22 21:40:32 UTC

[GitHub] [arrow-datafusion] viirya commented on a diff in pull request #6416: chore(deps): update sqlparser requirement from 0.33 to 0.34

viirya commented on code in PR #6416:
URL: https://github.com/apache/arrow-datafusion/pull/6416#discussion_r1201182885


##########
datafusion/sql/src/expr/mod.rs:
##########
@@ -350,11 +350,25 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
             within_group,
         } = array_agg;
 
-        let order_by = if let Some(order_by) = order_by {
+        let order_by = if let Some(mut order_by) = order_by {
             // TODO: Once sqlparser supports multiple order by clause, handle it
             //       see issue: https://github.com/sqlparser-rs/sqlparser-rs/issues/875
+            let order_by = match order_by.len() {
+                0 => {
+                    return Err(DataFusionError::NotImplemented(
+                        "ARRAY_AGG with empty ORDER BY not supported".to_string(),
+                    ))
+                }

Review Comment:
   Hmm isn't `ORDER BY` an optional clause?
   
   For example, in `aggregate_functions.md`:
   
   ```
   array_agg(expression [ORDER BY expression])
   ```



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