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

Error during planning: Projection references non-aggregate values #8898

Closed
alamb opened this issue Jan 17, 2024 · 0 comments · Fixed by #8890
Closed

Error during planning: Projection references non-aggregate values #8898

alamb opened this issue Jan 17, 2024 · 0 comments · Fixed by #8890

Comments

@alamb
Copy link
Contributor

alamb commented Jan 17, 2024

This query fails:

SELECT a + 1 AS d, a + 1 + b AS c FROM (SELECT 1 AS a, 2 AS b) GROUP BY a + 1, a + 1 + b;
Error during planning: Projection references non-aggregate values: Expression b could not be resolved from available columns: a + Int64(1), a + Int64(1) + b

because we are transform_up in rebase_expr()
a+1+b is split to a+1 and b, then we found b is not in group list.

Originally posted by @wizardxz in #8280 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant