Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for using aliases created in select list in GROUP BY and ORDER BY #571

Closed
alancai98 opened this issue Apr 11, 2022 · 2 comments · Fixed by #740
Closed

Add support for using aliases created in select list in GROUP BY and ORDER BY #571

alancai98 opened this issue Apr 11, 2022 · 2 comments · Fixed by #740
Assignees
Labels
enhancement New feature or request S Small sized task

Comments

@alancai98
Copy link
Member

Thanks @alancai98, I can use Order By now. I also want to add alias support for Order By and Group By. Currently, following queries are not working because of missing bindings.

  • SELECT a as b FROM table ORDER BY b
  • SELECT a as b FROM table GROUP BY b

Do you mind if I open a new PR to support for aliases, if can implement? or Do I need to open an issue for this?

Originally posted by @onurkuruu in #554 (comment)

@alancai98 alancai98 added enhancement New feature or request S Small sized task labels Apr 12, 2022
@johnedquinn johnedquinn self-assigned this Jun 6, 2022
@johnedquinn
Copy link
Member

Taking a look at this. Currently, the following query results in: EvaluationException

SELECT a AS b FROM << {'a': 5}, {'a': 6} >> ORDER BY b;

And, the following query works (Note the ORDER BY <variable>):

SELECT a AS b FROM << {'a': 5}, {'a': 6} >> ORDER BY a;
[
  {
    'b': 5
  },
  {
    'b': 6
  }
]

The goal should be to get the first query to work.

@johnedquinn johnedquinn removed their assignment Jun 16, 2022
@johnedquinn johnedquinn self-assigned this Sep 6, 2022
@johnedquinn
Copy link
Member

So, taking a look @ this again. I haven't done a ton of research, but I saw this tid-bit on StackOverflow making me think that GROUP BY will never support projection aliases.

Anyways, I made some changes to ORDER BY, and I'll be posting a PR soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request S Small sized task
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants