You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "Jason Wang (JIRA)" <ji...@apache.org> on 2016/02/10 05:30:18 UTC

[jira] [Commented] (KYLIN-899) add "if" support in sum

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

Jason Wang commented on KYLIN-899:
----------------------------------

Correct me if I'm wrong, but I think the statement
"select sum(col) filter (where col>1024) as newcol from testtabale"
is equivalent to
"select sum(col) as newcol from testtabale where col>1024" which is supported by Kylin.

When there are multiple aggregates, each aggregate should be calculated in the same fashion.

With 1.2 release, the sum(col) filter (where condition) query gives the wrong result, as if there is no filter at all, and that is worse than simply throwing an error for obvious reasons.

> add "if" support in sum
> -----------------------
>
>                 Key: KYLIN-899
>                 URL: https://issues.apache.org/jira/browse/KYLIN-899
>             Project: Kylin
>          Issue Type: Wish
>            Reporter: liangmeng
>
> add "if" support in  sum,such as :
> select sum(if(col>1024,col,0)) as newcol from testtabale;



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)