From 72451affb649f0f6a23ce83de8d31f7a3f9d03b7 Mon Sep 17 00:00:00 2001 From: Ruben Quesada Lopez Date: Sat, 13 Jul 2024 11:41:54 +0100 Subject: [PATCH] Minor: add Quidem test --- core/src/test/resources/sql/sub-query.iq | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/core/src/test/resources/sql/sub-query.iq b/core/src/test/resources/sql/sub-query.iq index 69b05cad8dc8..460618045c78 100644 --- a/core/src/test/resources/sql/sub-query.iq +++ b/core/src/test/resources/sql/sub-query.iq @@ -3800,4 +3800,18 @@ SELECT array(SELECT empno FROM emp WHERE empno > 7800 ORDER BY empno DESC LIMIT !ok +# [CALCITE-6468] RelDecorrelator throws AssertionError if correlated variable +# is used as Aggregate group key +WITH agg_sal AS + (SELECT deptno, sum(sal) AS total FROM emp GROUP BY deptno) +SELECT 1 FROM agg_sal s1 +WHERE s1.total > (SELECT avg(total) FROM agg_sal s2 WHERE s1.deptno = s2.deptno); ++--------+ +| EXPR$0 | ++--------+ ++--------+ +(0 rows) + +!ok + # End sub-query.iq