This is an automated email from the ASF dual-hosted git repository.

xuzifu666 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/calcite.git


The following commit(s) were added to refs/heads/main by this push:
     new 30adb3635c Test case for [CALCITE-5420] SqlToRel should populate the 
correlate id of a Project for queries with aggregates
30adb3635c is described below

commit 30adb3635c98d0ca88aee387003599b56bae67b2
Author: Yu Xu <[email protected]>
AuthorDate: Thu Aug 6 14:53:24 2026 +0800

    Test case for [CALCITE-5420] SqlToRel should populate the correlate id of a 
Project for queries with aggregates
---
 core/src/test/resources/sql/sub-query.iq | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/core/src/test/resources/sql/sub-query.iq 
b/core/src/test/resources/sql/sub-query.iq
index e1cf406081..d6364652cc 100644
--- a/core/src/test/resources/sql/sub-query.iq
+++ b/core/src/test/resources/sql/sub-query.iq
@@ -1206,6 +1206,24 @@ EnumerableCalc(expr#0..3=[{inputs}], ENAME=[$t1], 
DEEP2SAL=[$t3])
 !plan
 !}
 
+# [CALCITE-5420] SqlToRel should populate the correlate id of a Project for 
queries with aggregates
+SELECT deptno,
+       SUM((SELECT char_length(dname) FROM "scott".dept
+            WHERE dept.deptno = emp.deptno)) AS s
+FROM   "scott".emp
+GROUP BY deptno
+ORDER BY deptno;
++--------+----+
+| DEPTNO | S  |
++--------+----+
+|     10 | 30 |
+|     20 | 40 |
+|     30 | 30 |
++--------+----+
+(3 rows)
+
+!ok
+
 # [CALCITE-1494] Inefficient plan for correlated sub-queries
 # Plan must have only one scan each of emp and dept.
 select sal

Reply via email to