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

Temple Zhou commented on KYLIN-3887:
------------------------------------

Before KYLIN-2982 update_sum_measure_default_return_type,

cubeMeasures.js:
{code:javascript}
switch($scope.newMeasure.function.expression){
        case "SUM":
          
if(colType==="tinyint"||colType==="smallint"||colType==="int"||colType==="bigint"||colType==="integer"){
            $scope.newMeasure.function.returntype= 'bigint';
          }else{
           
if(colType.indexOf('decimal')!=-1||colType==="double"||colType==="float"){
              $scope.newMeasure.function.returntype= 'decimal(19,4)';
            }else{
              $scope.newMeasure.function.returntype= 'decimal(14,0)';
            }
          }
          break;
{code}
this method will set the return type to decimal when your column type is double.

So, the temporary solution is to reedit the cube via WEB UI(new version), and 
rebuild the cube.

> Query with decimal sum measure of double complied failed after KYLIN-3703
> -------------------------------------------------------------------------
>
>                 Key: KYLIN-3887
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3887
>             Project: Kylin
>          Issue Type: Bug
>            Reporter: Liu Shaohui
>            Assignee: nichunen
>            Priority: Major
>             Fix For: Future, v3.0.0
>
>         Attachments: image-2019-05-14-11-19-05-514.png
>
>
> After KYLIN-3703, Query with decimal sum measure of double complied failed.
> {code:java}
> Caused by: org.codehaus.commons.compiler.CompileException: 
> Line 112, Column 42: Cannot cast "java.math.BigDecimal" to 
> "java.lang.Double"{code}



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

Reply via email to