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

PG-incompatibility: parentheses after GROUP BY shall not be row constructor #14708

Open
xiangjinwu opened this issue Jan 22, 2024 · 1 comment
Labels
component/frontend Protocol, parsing, binder. help wanted Issues that need help from contributors no-issue-activity priority/low type/bug Something isn't working

Comments

@xiangjinwu
Copy link
Contributor

When used in SELECT list, a pair of parentheses is treated as simplified version of row constructor:

test=# create table t (id int, cat varchar, at timestamptz);
CREATE TABLE
test=# insert into tt values (1, 'foo', now()), (2, 'foo', now());
INSERT 0 2

test=# select id, cat from t;
 id | cat 
----+-----
  1 | foo
  2 | foo
(2 rows)

test=# select (id, cat) from t;
   row   
---------
 (1,foo)
 (2,foo)
(2 rows)

test=# select row(id, cat) from t;
   row   
---------
 (1,foo)
 (2,foo)
(2 rows)

However, this shall not be the case after GROUP BY:

test=# select id from t group by 3+2, (id, cat);
 id 
----
  2
  1
(2 rows)

test=# select id from t group by 3+2, row(id, cat);
ERROR:  column "t.id" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: select id from t group by 3+2, row(id, cat);
               ^

As of now, RisingWave reports the same error in both cases, treating parentheses same as row constructor.

@xiangjinwu xiangjinwu added type/bug Something isn't working component/frontend Protocol, parsing, binder. priority/low labels Jan 22, 2024
@github-actions github-actions bot added this to the release-1.7 milestone Jan 22, 2024
@xiangjinwu xiangjinwu removed this from the release-1.7 milestone Jan 22, 2024
@lmatz lmatz added the help wanted Issues that need help from contributors label Jan 22, 2024
Copy link
Contributor

This issue has been open for 60 days with no activity. Could you please update the status? Feel free to continue discussion or close as not planned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/frontend Protocol, parsing, binder. help wanted Issues that need help from contributors no-issue-activity priority/low type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants