iwanttobepowerful commented on code in PR #4670: URL: https://github.com/apache/calcite/pull/4670#discussion_r2600927135
########## core/src/test/resources/sql/sub-query.iq: ########## @@ -5505,4 +5505,54 @@ WHERE EXISTS (2 rows) !ok + +# [CALCITE-7297] The result is incorrect when the GROUP BY key in a subquery is a RexFieldAccess +SELECT *, + (SELECT COUNT(*) + FROM + ( + SELECT empno, ename, job + FROM emp + WHERE emp.deptno = dept.deptno) AS sub + GROUP BY deptno) AS num_dept_groups +FROM dept; ++--------+------------+----------+-----------------+ +| DEPTNO | DNAME | LOC | NUM_DEPT_GROUPS | ++--------+------------+----------+-----------------+ +| 10 | ACCOUNTING | NEW YORK | 3 | +| 20 | RESEARCH | DALLAS | 5 | +| 30 | SALES | CHICAGO | 6 | +| 40 | OPERATIONS | BOSTON | | ++--------+------------+----------+-----------------+ +(4 rows) + +!ok + +# [CALCITE-7297] The result is incorrect when the GROUP BY key in a subquery is a RexFieldAccess +SELECT *, + (SELECT COUNT(*) + FROM + ( + SELECT empno, ename, job, comm + FROM emp + WHERE emp.deptno = dept.deptno) AS sub + GROUP BY sub.comm) AS num_dept_groups +FROM dept; +more than one value in agg SINGLE_VALUE +!error Review Comment: done -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
