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

output of group by #117

Closed
fdncred opened this issue Sep 10, 2024 · 9 comments
Closed

output of group by #117

fdncred opened this issue Sep 10, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@fdncred
Copy link

fdncred commented Sep 10, 2024

Describe the bug
I expected this query to produce 1 row. The

 ^gitql -q 'select author_name, count(author_name) AS auth_count from commits group by author_name order by count(author_name)'
╭──────────────────┬────────────╮
 author_name       auth_count 
╞══════════════════╪════════════╡
 Darren Schroeder  6          
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
 Darren Schroeder  6          
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
 Darren Schroeder  6          
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
 Darren Schroeder  6          
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
 Darren Schroeder  6          
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
 Darren Schroeder  6          
╰──────────────────┴────────────╯

There are indeed 6 commits, but shouldn't group by only show the aggregate of 1?

 ^gitql -q 'select author_name from commits'
╭──────────────────╮
 author_name      
╞══════════════════╡
 Darren Schroeder 
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
 Darren Schroeder 
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
 Darren Schroeder 
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
 Darren Schroeder 
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
 Darren Schroeder 
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
 Darren Schroeder 
╰──────────────────╯

GQL (please complete the following information):
❯ ^gitql --version
GitQL version 0.27.0

@AmrDeveloper AmrDeveloper added the bug Something isn't working label Sep 10, 2024
@AmrDeveloper
Copy link
Owner

Thank you for reporting @fdncred,

This is important to handled

AmrDeveloper added a commit that referenced this issue Sep 11, 2024
@AmrDeveloper
Copy link
Owner

It fixed now, you can run the query from issue description and get good result,

Thanks for reporting, i will release it next version

@fdncred
Copy link
Author

fdncred commented Sep 11, 2024

Thanks. I'm trying to integrate into a nushell plugin and was wondering why my code didn't work. Then I tried your cli and found out the results were the same. 🤣 Thanks for working on this. I'll try and test it in the next day or so.

@AmrDeveloper
Copy link
Owner

Thats cool idea to integrate it with nushell plugin,

@fdncred
Copy link
Author

fdncred commented Sep 11, 2024

prototype
image

@AmrDeveloper
Copy link
Owner

prototype
image

Cool 😅

@AmrDeveloper
Copy link
Owner

I think we can close this

@fdncred fdncred closed this as completed Sep 16, 2024
@fdncred
Copy link
Author

fdncred commented Sep 16, 2024

Thanks for your help! I'm really enjoying GQL!

@AmrDeveloper
Copy link
Owner

Thanks for your help! I'm really enjoying GQL!

Thank you, i think it can be even better when implementing line editor, sub query, user defined functions, some optimisations and tree rewriting, but step by step :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants