Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
chucheng92 committed Oct 19, 2023
1 parent 27b7809 commit 960809f
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions core/src/test/resources/sql/sub-query.iq
Original file line number Diff line number Diff line change
Expand Up @@ -3686,6 +3686,7 @@ FROM dept d1;
!ok

# [CALCITE-6041] MAP sub-query gives NullPointerException
# map size > 1
SELECT map(SELECT empno, deptno from emp where deptno < 20);
+-----------------------------+
| EXPR$0 |
Expand All @@ -3696,4 +3697,28 @@ SELECT map(SELECT empno, deptno from emp where deptno < 20);

!ok

# [CALCITE-6041] MAP sub-query gives NullPointerException
# map size = 1
SELECT map(SELECT empno, deptno from emp where empno = 7369);
+-----------+
| EXPR$0 |
+-----------+
| {7369=20} |
+-----------+
(1 row)

!ok

# [CALCITE-6041] MAP sub-query gives NullPointerException
# empty map
SELECT map(SELECT empno, deptno from emp where false);
+--------+
| EXPR$0 |
+--------+
| {} |
+--------+
(1 row)

!ok

# End sub-query.iq

0 comments on commit 960809f

Please sign in to comment.