GROUP BY on a CASE expression containing IN predicate fails

Details

Description

The following query which does a Group-By on a CASE expression that contains IN predicate fails. If I replace the IN with an equality or <, > the query succeeds. I am not on latest Calcite master but I suspect the same problem exists there.

select (casewhen emp.empno in (3) then 0 else 1 end)
from emp
groupby (casewhen emp.empno in (3) then 0 else 1 end);
java.lang.AssertionError: Internal error: while converting CASEWHEN `EMP`.`EMPNO` IN (3) THEN 0 ELSE 1 ENDat org.eigenbase.util.Util.newInternal(Util.java:750)
at org.eigenbase.sql2rel.ReflectiveConvertletTable$1.convertCall(ReflectiveConvertletTable.java:93)
at org.eigenbase.sql2rel.SqlNodeToRexConverterImpl.convertCall(SqlNodeToRexConverterImpl.java:52)
at org.eigenbase.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:4093)
at org.eigenbase.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:1)
at org.eigenbase.sql.SqlCall.accept(SqlCall.java:125)
at org.eigenbase.sql2rel.SqlToRelConverter$Blackboard.convertExpression(SqlToRelConverter.java:3988)
at org.eigenbase.sql2rel.SqlToRelConverter$AggConverter.addGroupExpr(SqlToRelConverter.java:4314)
at org.eigenbase.sql2rel.SqlToRelConverter.createAggImpl(SqlToRelConverter.java:2240)
at org.eigenbase.sql2rel.SqlToRelConverter.convertAgg(SqlToRelConverter.java:2191)
at org.eigenbase.sql2rel.SqlToRelConverter.convertSelectImpl(SqlToRelConverter.java:514)
at org.eigenbase.sql2rel.SqlToRelConverter.convertSelect(SqlToRelConverter.java:474)