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 2023/05/22 21:11:14 UTC

[GitHub] [arrow-datafusion] alamb opened a new pull request, #6416: chore(deps): update sqlparser requirement from 0.33 to 0.34

alamb opened a new pull request, #6416:
URL: https://github.com/apache/arrow-datafusion/pull/6416

   # Which issue does this PR close?
   
   Closes https://github.com/apache/arrow-datafusion/pull/6407
   
   # Rationale for this change
   
   @dependabot did most of the work but the code changes were non trivial enough I wanted to make a separate PR
   
   # What changes are included in this PR?
   
   Update sqlparser-rs dependecy
   Update datafusion for changes in API (mostly add error about new syntax not being supported)
   
   # Are these changes tested?
   Yes
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   -->
   
   # Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->


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


[GitHub] [arrow-datafusion] alamb merged pull request #6416: chore(deps): update sqlparser requirement from 0.33 to 0.34

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #6416:
URL: https://github.com/apache/arrow-datafusion/pull/6416


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


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

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #6416:
URL: https://github.com/apache/arrow-datafusion/pull/6416#discussion_r1202142070


##########
datafusion/sql/src/statement.rs:
##########
@@ -404,11 +404,18 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
             }
 
             Statement::Delete {

Review Comment:
   This is due to changes in https://github.com/sqlparser-rs/sqlparser-rs/pull/855



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


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

Posted by "viirya (via GitHub)" <gi...@apache.org>.
viirya commented on code in PR #6416:
URL: https://github.com/apache/arrow-datafusion/pull/6416#discussion_r1201185396


##########
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:
   Oh, nvm, this is the expressions of `ORDER BY`.



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


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

Posted by "viirya (via GitHub)" <gi...@apache.org>.
viirya commented on code in PR #6416:
URL: https://github.com/apache/arrow-datafusion/pull/6416#discussion_r1201184729


##########
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(),
+                    ))
+                }
+                1 => order_by.pop().unwrap(),
+                n => {
+                    return Err(DataFusionError::NotImplemented(format!(
+                        "ARRAY_AGG only supports a single ORDER BY expressio. Got {n}"

Review Comment:
   ```suggestion
                           "ARRAY_AGG only supports a single ORDER BY expression. Got {n}"
   ```



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


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

Posted by "viirya (via GitHub)" <gi...@apache.org>.
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