Navigation Menu

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

GROUPING SETS on groups with aliases provided in the SELECT returns empty result #7185

Closed
Mytherin opened this issue Oct 12, 2021 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@Mytherin
Copy link

To Reproduce

create table students (course TEXT, type TEXT);
insert into students
		(course, type)
	values
		('CS', 'Bachelor'),
		('CS', 'Bachelor'),
		('CS', 'PhD'),
		('Math', 'Masters'),
		('CS', NULL),
		('CS', NULL),
		('Math', NULL);
-- without aliases the query works as expected
select count(*), course, type
        from students
        group by grouping sets((course, type), (type))
        order by 1, 2, 3;
-- with aliases no result is returned
select count(*), course AS crs, type AS tp
        from students
        group by grouping sets((crs, tp), (tp))
        order by 1, 2, 3;

Expected behavior
Expect the following result from both queries:

+------+--------+----------+
| %1   | course | type     |
+======+========+==========+
|    1 | null   | Masters  |
|    1 | null   | PhD      |
|    1 | CS     | PhD      |
|    1 | Math   | null     |
|    1 | Math   | Masters  |
|    2 | null   | Bachelor |
|    2 | CS     | null     |
|    2 | CS     | Bachelor |
|    3 | null   | null     |
+------+--------+----------+

Software versions

  • MonetDB v11.41.5 (Jul2021)
  • MacOS
  • Homebrew
@PedroTadim
Copy link
Contributor

I didn't know grouping columns could contain aliases in in the relational tree. Thanks for the report! It will be fixed on the next release.

@PedroTadim PedroTadim added the bug Something isn't working label Oct 12, 2021
@PedroTadim PedroTadim added this to the NEXTRELEASE milestone Oct 12, 2021
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

3 participants