You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "陈虹 (Jira)" <ji...@apache.org> on 2021/04/16 08:06:00 UTC

[jira] [Created] (KYLIN-4977) sum 的数据类型

陈虹 created KYLIN-4977:
-------------------------

             Summary: sum 的数据类型
                 Key: KYLIN-4977
                 URL: https://issues.apache.org/jira/browse/KYLIN-4977
             Project: Kylin
          Issue Type: Bug
          Components: Query Engine
    Affects Versions: v3.0.0
            Reporter: 陈虹
             Fix For: Future
         Attachments: 微信图片_20210416160817.png

问题1: 使用 sum case when 的时候,数据类型转换报错:

SQL:" select unit_code, sum(case when task_type='11' then amount else 0 end ) amount1, sum(case when task_type='12' then amount else 0 end ) amount2 from im_tasks group by unit_code"

amount 是double类型,sum(amount)也是double,在查询时报错:

java.math.BigDecimal cannot be cast to java.lang.Double while executing SQL

 

问题2:加了强制转换类型,执行后超时了:

SQL:" select unit_code, sum(case when task_type='11' then amount else cast('0.0' as double) end ) amount1, sum(case when task_type='12' then amount else cast('0.0' as double) end ) amount2 from im_tasks group by unit_code"

在查询时报错:

Coprocessor passed deadline! Maybe server is overloaded as ……



--
This message was sent by Atlassian Jira
(v8.3.4#803005)