You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "Chao Long (JIRA)" <ji...@apache.org> on 2019/04/15 05:41:00 UTC
[jira] [Updated] (KYLIN-3957) Query system_cube get exception
Cannot cast "java.math.BigDecimal" to "java.lang.Double"
[ https://issues.apache.org/jira/browse/KYLIN-3957?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chao Long updated KYLIN-3957:
-----------------------------
Description:
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}
> 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)