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

[jira] [Updated] (KYLIN-4674) support cast in sum() expression

     [ https://issues.apache.org/jira/browse/KYLIN-4674?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Zhong Yanghong updated KYLIN-4674:
----------------------------------
    Description: 
Make it possible to support the following sql:

{code}

select LSTG_FORMAT_NAME,
 sum(cast(ITEM_COUNT as decimal(18, 6))),
 sum(case
 when LSTG_FORMAT_NAME = 'ABIN' then cast(ITEM_COUNT as decimal(18, 6))
 when LSTG_FORMAT_NAME = 'Auction' then 2
 end),
 sum(cast(case
 when LSTG_FORMAT_NAME = 'ABIN' then ITEM_COUNT
 when LSTG_FORMAT_NAME = 'Auction' then 2
 end as decimal(18, 6)))
from TEST_KYLIN_FACT
group by LSTG_FORMAT_NAME

{code}

> support cast in sum() expression
> --------------------------------
>
>                 Key: KYLIN-4674
>                 URL: https://issues.apache.org/jira/browse/KYLIN-4674
>             Project: Kylin
>          Issue Type: Improvement
>            Reporter: Zhong Yanghong
>            Assignee: Zhong Yanghong
>            Priority: Major
>
> Make it possible to support the following sql:
> {code}
> select LSTG_FORMAT_NAME,
>  sum(cast(ITEM_COUNT as decimal(18, 6))),
>  sum(case
>  when LSTG_FORMAT_NAME = 'ABIN' then cast(ITEM_COUNT as decimal(18, 6))
>  when LSTG_FORMAT_NAME = 'Auction' then 2
>  end),
>  sum(cast(case
>  when LSTG_FORMAT_NAME = 'ABIN' then ITEM_COUNT
>  when LSTG_FORMAT_NAME = 'Auction' then 2
>  end as decimal(18, 6)))
> from TEST_KYLIN_FACT
> group by LSTG_FORMAT_NAME
> {code}



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