libenchao commented on code in PR #2974:
URL: https://github.com/apache/calcite/pull/2974#discussion_r1070491944


##########
core/src/test/resources/sql/agg.iq:
##########
@@ -3467,4 +3467,38 @@ order by ename, deptno;
 
 !ok
 
+# Test cases for [CALCITE-5209] ArrayIndexOutOfBoundsException during 
SqlToRelConverter for group-by on `case`
+# having `in` expression predicates exceeding SqlRelConverter.Config 
InSubQueryThreshold
+!use scott
+select
+    case when deptno in (1, 2, 3, 4, 5) THEN 1 else 0 end
+from emp
+group by
+    case when deptno in (1, 2, 3, 4, 5) THEN 1 else 0 end;
+
++--------+
+| EXPR$0 |
++--------+
+|      0 |
++--------+
+(1 row)
+
+!ok
+
+!set insubquerythreshold 5
+select
+    case when deptno in (1, 2, 3, 4, 5) THEN 1 else 0 end

Review Comment:
   This looks better!



-- 
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: commits-unsubscr...@calcite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to