You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/04/28 01:43:49 UTC

[GitHub] [arrow-datafusion] jychen7 opened a new issue #215: Group by Alias

jychen7 opened a new issue #215:
URL: https://github.com/apache/arrow-datafusion/issues/215


   **Describe the bug**
   https://github.com/apache/arrow-datafusion/issues/110 suggests we can group by alias, however, I modify the existing test case `select_simple_aggregate_with_groupby_with_aliases` a bit, then it fails
   
   **To Reproduce**
   ```
   SELECT state AS a, MIN(age) AS b FROM person GROUP BY state
   ```
   shows correct answer
   
   ```
   SELECT state AS a, MIN(age) AS b FROM person GROUP BY a
   ```
   raises error `Plan("Projection references non-aggregate values")`
   
   **Expected behavior**
   ```
   SELECT state AS a, MIN(age) AS b FROM person GROUP BY state
   
   SELECT state AS a, MIN(age) AS b FROM person GROUP BY a
   ```
   returns same answer
   


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

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



[GitHub] [arrow-datafusion] alamb closed issue #215: Group by Alias

Posted by GitBox <gi...@apache.org>.
alamb closed issue #215:
URL: https://github.com/apache/arrow-datafusion/issues/215


   


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

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



[GitHub] [arrow-datafusion] jychen7 commented on issue #215: Group by Alias

Posted by GitBox <gi...@apache.org>.
jychen7 commented on issue #215:
URL: https://github.com/apache/arrow-datafusion/issues/215#issuecomment-828077671


   I think we could `resolve_aliases_to_exprs` for `select.group_by`
   similar to
   datafusion/blob/e86ad26a678a32e2743bc031ae5cb81e6931a231/datafusion/src/sql/planner.rs#L563-L566
   
   However, as a rust learner, I am still on the way struggling the rust typing system when deal with the array mapping


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

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



[GitHub] [arrow-datafusion] alamb commented on issue #215: Group by Alias

Posted by GitBox <gi...@apache.org>.
alamb commented on issue #215:
URL: https://github.com/apache/arrow-datafusion/issues/215#issuecomment-828367985


   Thanks @jychen7  -- the expected behavior looks correct here 👍  Let us know if you need any help with the Rust


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

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