iwanttobepowerful commented on code in PR #4670:
URL: https://github.com/apache/calcite/pull/4670#discussion_r2600880946


##########
core/src/test/resources/sql/sub-query.iq:
##########
@@ -5505,4 +5505,41 @@ 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;
++--------+------------+----------+-----------------+

Review Comment:
   > or `GROUP BY col2`, where col2 can be nullable?
   
   added



-- 
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]

Reply via email to