Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.

Support for GROUP BY on aliased fields #375

Closed
campoy opened this issue Sep 21, 2018 · 3 comments
Closed

Support for GROUP BY on aliased fields #375

campoy opened this issue Sep 21, 2018 · 3 comments
Labels
bug Something isn't working

Comments

@campoy
Copy link

campoy commented Sep 21, 2018

This seems like a bug on the scope management for identifiers.

While this query works:

select repository_id, count(ref_name) as count
from refs
group by repository_id;

This one fails with the error message column "repo" could not be found in any table in scope:

select repository_id as repo, count(ref_name) as count
from refs
group by repo;

My current workaround is to use a nested query, but this is clearly a hack.

select repo, count(ref_name) as count
from (
    select repository_id as repo, ref_name
    from refs
) as t
group by repo;
@ajnavarro ajnavarro added the bug Something isn't working label Sep 24, 2018
@ajnavarro
Copy link
Contributor

This should be fixed by #368

Can you try updating to latest master?

@campoy
Copy link
Author

campoy commented Sep 24, 2018

This issues is fixed in the latest release, when will it be deployed to dockerhub?
We need to make sure these fixes are on the gitbase image so the engine benefits from it.

@ajnavarro
Copy link
Contributor

deployed as v0.17.0-rc.3 https://hub.docker.com/r/srcd/gitbase/tags/

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

No branches or pull requests

2 participants