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

UNION ALL push down projection rule failed #6386

Closed
comphead opened this issue May 18, 2023 · 4 comments
Closed

UNION ALL push down projection rule failed #6386

comphead opened this issue May 18, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@comphead
Copy link
Contributor

Describe the bug

Bug description below

To Reproduce

❯ WITH w1 AS (select 1 as x , max(10) as y), w2 AS (select 5 as n_regionkey)
select count(*) cnt from w2 group by n_regionkey
union all
select x from w1;
Optimizer rule 'push_down_projection' failed
caused by
Error during planning: Aggregate requires at least one grouping or aggregate expression

Expected behavior

Query should work

Additional context

part of UNION ALL problems and originated from #5747

@comphead comphead added the bug Something isn't working label May 18, 2023
@jonmmease
Copy link
Contributor

In case it's helpful, here's another query (without a UNION) that triggers this error:

WITH tbl_0 as (SELECT 0 as "colA")
SELECT "colA" FROM tbl_0
CROSS JOIN (SELECT count(0) as "total" from tbl_0)

@comphead
Copy link
Contributor Author

Thanks @jonmmease for reporting this. I'm on it now, hope to close both issues.

@Dandandan
Copy link
Contributor

This might be a similar issue #8450

@Dandandan
Copy link
Contributor

Dandandan commented Dec 8, 2023

It looks like this is solved by #8459 as well

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