[ 
https://issues.apache.org/jira/browse/KYLIN-3957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16818571#comment-16818571
 ] 

ASF subversion and git services commented on KYLIN-3957:
--------------------------------------------------------

Commit 595c4e2112afeaea8c2881626959e37bbed50c84 in kylin's branch 
refs/heads/master from chao long
[ https://gitbox.apache.org/repos/asf?p=kylin.git;h=595c4e2 ]

KYLIN-3957 Fix exception cannot cast 'java.math.BigDecimal' to 
'java.lang.Double'


> Query system_cube get exception Cannot cast "java.math.BigDecimal" to 
> "java.lang.Double"
> ----------------------------------------------------------------------------------------
>
>                 Key: KYLIN-3957
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3957
>             Project: Kylin
>          Issue Type: Bug
>          Components: Query Engine
>            Reporter: Chao Long
>            Assignee: Chao Long
>            Priority: Major
>
> In system cube, the return dataType of column whose real dataType is Double 
> will be converted to Decimal in SUM measure.
> {code:java}
>         FunctionDesc function = new FunctionDesc();
>         function.setExpression(FunctionDesc.FUNC_SUM);
>         function.setParameter(parameterDesc);
>         
> function.setReturnType(dataType.equals(HiveTableCreator.HiveTypeEnum.HDOUBLE.toString())
>                 ? HiveTableCreator.HiveTypeEnum.HDECIMAL.toString()
>                 : dataType);
> {code}
> but query with that measure will get exception:
> {code}
> Caused by: org.codehaus.commons.compiler.CompileException: Line 108, Column 
> 44: Cannot cast "java.math.BigDecimal" to "java.lang.Double"
>       at 
> org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:10092)
>       at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:3839)
>       at org.codehaus.janino.UnitCompiler.access$6400(UnitCompiler.java:183)
>       at org.codehaus.janino.UnitCompiler$10.visitCast(UnitCompiler.java:3246)
>       at org.codehaus.janino.Java$Cast.accept(Java.java:3802)
>       at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:3278)
>       at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:3845)
>       at org.codehaus.janino.UnitCompiler.access$8600(UnitCompiler.java:183)
>       at 
> org.codehaus.janino.UnitCompiler$10.visitParenthesizedExpression(UnitCompiler.java:3274)
>       at 
> org.codehaus.janino.Java$ParenthesizedExpression.accept(Java.java:3830)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to