Description
AssertionError when we use case with optional value and literal using ReduceExpressionsRule:
SELECT CASE WHEN 1=2 THEN cast((values(1)) as integer) ELSE 2 end from (values(1))
Stack trace:
java.lang.AssertionError: Internal error: Cannot add expression of different type to set: set type is RecordType(INTEGER EXPR$0) NOT NULL expression type is RecordType(INTEGER NOT NULL EXPR$0) NOT NULL set is rel#14:LogicalProject(input=HepRelVertex#13,EXPR$0=CASE(=(1, 2), CAST($1):INTEGER, 2)) expression is LogicalProject#16
Attachments
Issue Links
- relates to
-
CALCITE-2026 AssertionError when ProjectReduceExpressionsRule simplifies project expressions
- Closed
-
HIVE-13094 CBO: Assertion error in Case expression
- Closed