Uploaded image for project: 'Kylin'
  1. Kylin
  2. KYLIN-3957

Query system_cube get exception Cannot cast "java.math.BigDecimal" to "java.lang.Double"

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: v2.6.1
    • Fix Version/s: v3.0.0, v2.6.2
    • Component/s: Query Engine
    • Labels:
      None

      Description

      In system cube, the return dataType of column whose real dataType is Double will be converted to Decimal in SUM measure.

              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);
      

      but query with that measure will get exception:

      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)
      
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Wayne0101 Chao Long
                Reporter:
                Wayne0101 Chao Long
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: