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

Julian Hyde closed OPTIQ-387.
-----------------------------

> CompileException when cast TRUE to nullable boolean
> ---------------------------------------------------
>
>                 Key: OPTIQ-387
>                 URL: https://issues.apache.org/jira/browse/OPTIQ-387
>             Project: Optiq
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Julian Hyde
>             Fix For: 0.9.1-incubating
>
>
> In contexts where boolean values can be null, we need to convert them to 
> java.lang.Boolean. Query
> {code:sql}
> select case when deptno = 10 then null else true end
> from (values (10), (20)) as t(deptno)
> {code}
> gives
> {code}
> Caused by: org.codehaus.commons.compiler.CompileException: Line 25, Column 
> 104: Incompatible expression types "java.lang.Boolean" and "boolean"
>       at 
> org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:10064)
>       at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:3643)
>       at org.codehaus.janino.UnitCompiler.access$6600(UnitCompiler.java:181)
>       at 
> org.codehaus.janino.UnitCompiler$10.visitConditionalExpression(UnitCompiler.java:3268)
> {code}
> from compiling the generated code
> {code:java}
>             public Object current() {
>               return 
> net.hydromatic.optiq.runtime.SqlFunctions.toInt(inputEnumerator.current()) == 
> 10 ? (Boolean) null : true;
>             }
> {code}



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

Reply via email to