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

Positional arguments in group by not being properly inferred in subqueries with select * #56466

Closed
priera opened this issue Nov 8, 2023 · 0 comments · Fixed by #62457
Closed

Comments

@priera
Copy link
Contributor

priera commented Nov 8, 2023

Describe the issue
A GROUP BY clause with positional arguments will report error when it is nested within a subquery.

How to reproduce
Extract from this fiddle:

SELECT *
FROM
(
	SELECT *
	FROM
	(
    	SELECT
        	name,
        	age
    	FROM users
	)
	GROUP BY
    	1,
    	2
)

reports the following error:
DB::Exception: Illegal value for positional argument in GROUP BY: While processing SELECT * FROM (SELECT name, age FROM users) GROUP BY 1, 2. (ILLEGAL_TYPE_OF_ARGUMENT)

Expected behavior:

Alice	50
John	33
Ksenia	48

Additional context

  • This functionality worked in versions prior to 22.12. Appears to be broken since then.
  • Replacing the positional arguments with the column names works as expected
  • It also works when enabling the experimental analyzer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants