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/07 16:30:26 UTC

[GitHub] [arrow-datafusion] xudong963 opened a new issue #1414: `group by` supports index

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


   **Is your feature request related to a problem or challenge? Please describe what you are trying to do.**
   `group by` supports index, such as `select a from foo order by 1;`
   
   **Describe the solution you'd like**
   We can add a special process in https://github.com/apache/arrow-datafusion/blob/b9866e62800700dd322e755cfbbbff6b0df48fa2/datafusion/src/sql/planner.rs#L820. Transfer `index` -> `column name`
   
   **Describe alternatives you've considered**
   No
   
   **Additional context**
   No
   


-- 
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] hntd187 commented on issue #1414: `order by` supports index in select list

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


   I'll give this a whirl, PR shortly


-- 
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 #1414: `order by` supports index

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


   FYI
   
   **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 1;
    a
   ---
    1
   
   (2 rows)
   ```
   
   **Datafusion**
   ```sql
   ❯ select column1 from foo order by 1;
   ArrowError(ExternalError(Plan("Sort operation is not applicable to scalar value 1")))
   ```
   


-- 
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 closed issue #1414: `order by` supports index in select list

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


   


-- 
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] hntd187 commented on issue #1414: `order by` supports index in select list

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


   Just verifying, this counts starting from 1 correct @xudong963 not 0?


-- 
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 closed issue #1414: `order by` supports index in select list

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


   


-- 
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 edited a comment on issue #1414: `order by` supports index in select list

Posted by GitBox <gi...@apache.org>.
xudong963 edited a comment on issue #1414:
URL: https://github.com/apache/arrow-datafusion/issues/1414#issuecomment-988087938


   FYI
   
   **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 1;
    a
   ---
    1
   
   (2 rows)
   
   postgres=# select a, b from foo order by 1;
    a | b
   ---+---
    1 | 2
      | 3
   (2 rows)
   
   postgres=# select a, b from foo order by 1 desc;
    a | b
   ---+---
      | 3
    1 | 2
   (2 rows)
   
   postgres=# select a, b from foo order by 2 desc;
    a | b
   ---+---
      | 3
    1 | 2
   (2 rows)
   
   postgres=# select a from foo order by 2;
   ERROR:  ORDER BY position 2 is not in select list
   LINE 1: select a from foo order by 2;
                                      ^
   postgres=#
   ```
   
   **Datafusion**
   ```sql
   ❯ select column1 from foo order by 1;
   ArrowError(ExternalError(Plan("Sort operation is not applicable to scalar value 1")))
   ```
   


-- 
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 #1414: `order by` supports index in select list

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


   Maybe the issue is suitable for newcomers, please add the `good first issue` 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] xudong963 commented on issue #1414: `order by` supports index in select list

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


   > Just verifying, this counts starting from 1 correct @xudong963 not 0?
   
   yes


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