[ 
https://issues.apache.org/jira/browse/CALCITE-1502?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Julian Hyde resolved CALCITE-1502.
----------------------------------
    Resolution: Fixed

Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/9b62ab3d. 
[~sharnyk], thanks for the PR!

> AssertionError when case statement is used with optional value and literal 
> using ReduceExpressionsRule
> ------------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-1502
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1502
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.10.0
>            Reporter: Serhii Harnyk
>            Assignee: Julian Hyde
>             Fix For: 1.11.0
>
>
> AssertionError when we use case with optional value and literal using 
> ReduceExpressionsRule:
> {noformat}
> SELECT CASE WHEN 1=2 THEN cast((values(1)) as integer) ELSE 2 end from 
> (values(1))
> {noformat}
> Stack trace:
> {noformat}
> 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
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to