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/12/05 13:34:19 UTC

[GitHub] [arrow-datafusion] xudong963 opened a new issue #1403: Group by uses unselect column is invalid

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


   **Describe the bug**
   Group by uses unselect column is invalid.
   such as `SELECT a FROM t ORDER BY b;` 
   
   **To Reproduce**
   Steps to reproduce the behavior:
   Postgres:
   ```sql
   postgres=# create table foo (
       a int,
       b int
   );
   CREATE TABLE
   postgres=# insert into foo (a, b) values (1, 2);
   insert into foo (a, b) values (null, 3);
   INSERT 0 1
   INSERT 0 1
   postgres=# select a from foo order by b;
    a
   ---
    1
   
   (2 rows)
   ```
   
   Datafusion
   ```sql
   ❯ create table foo as SELECT * FROM (VALUES (1,2), (2,3)) as t;
   0 rows in set. Query took 0.061 seconds.
   ❯ select * from foo;
   +---------+---------+
   | column1 | column2 |
   +---------+---------+
   | 1       | 2       |
   | 2       | 3       |
   +---------+---------+
   2 rows in set. Query took 0.006 seconds.
   ❯ select column1 from foo order by column2;
   Plan("No field named 'foo.column2'. Valid fields are 'foo.column1'.")
   ```
   
   
   **Expected behavior**
   A clear and concise description of what you expected to happen.
   
   **Additional context**
   Add any other context about the problem here.
   


-- 
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] xudong963 commented on issue #1403: Group by uses unselect column is invalid

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


   > this seems like a duplicate of #1372? I also commented a potential quick fix in there as well ;)
   
   Yes, sorry for not checking the existed issue.


-- 
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] houqp commented on issue #1403: Group by uses unselect column is invalid

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


   this seems like a duplicate of https://github.com/apache/arrow-datafusion/issues/1372? I also commented a potential quick fix in there as well ;)


-- 
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] xudong963 closed issue #1403: Group by uses unselect column is invalid

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


   


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