You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kylin.apache.org by Ding Dinghua <di...@gmail.com> on 2016/08/16 13:00:40 UTC

about count(a particular column) in kylin

Hi:
    Does kylin support count(a particular column) now?
   that is, count will skip rows which the particular column value is null.
    In our test, I found it is not supported currently(kylin-1.5.2),
     and I found that agg->aggCalls->arglist is null in
OLAPAggregateRule::convert when I submmit sql like:
    select dt, count(xxx) from test_table group by dt;
    The information about the particular column is lost in kylin, so I
want to know why?
     Since I found count(xxx) is support in calcite:
       https://calcite.apache.org/docs/reference.html

-- 
Ding Dinghua

Re: about count(a particular column) in kylin

Posted by Yerui Sun <su...@gmail.com>.
Kylin can’t support count(not null) directly, but there’s workaround.

Let’s say you have column ‘col1’, and want calculate count(col1 not null), you should create a new column ‘col2’, which col2 = if(col1 is not null, 1, 0), and then you can define a measure sum(col2) in kylin.

> 在 2016年8月17日,15:17,Ding Dinghua <di...@gmail.com> 写道:
> 
> ping...
> 
> 2016-08-16 21:00 GMT+08:00 Ding Dinghua <di...@gmail.com>:
>> Hi:
>>    Does kylin support count(a particular column) now?
>>   that is, count will skip rows which the particular column value is null.
>>    In our test, I found it is not supported currently(kylin-1.5.2),
>>     and I found that agg->aggCalls->arglist is null in
>> OLAPAggregateRule::convert when I submmit sql like:
>>    select dt, count(xxx) from test_table group by dt;
>>    The information about the particular column is lost in kylin, so I
>> want to know why?
>>     Since I found count(xxx) is support in calcite:
>>       https://calcite.apache.org/docs/reference.html
>> 
>> --
>> Ding Dinghua
> 
> 
> 
> -- 
> Ding Dinghua


Re: about count(a particular column) in kylin

Posted by Ding Dinghua <di...@gmail.com>.
ping...

2016-08-16 21:00 GMT+08:00 Ding Dinghua <di...@gmail.com>:
> Hi:
>     Does kylin support count(a particular column) now?
>    that is, count will skip rows which the particular column value is null.
>     In our test, I found it is not supported currently(kylin-1.5.2),
>      and I found that agg->aggCalls->arglist is null in
> OLAPAggregateRule::convert when I submmit sql like:
>     select dt, count(xxx) from test_table group by dt;
>     The information about the particular column is lost in kylin, so I
> want to know why?
>      Since I found count(xxx) is support in calcite:
>        https://calcite.apache.org/docs/reference.html
>
> --
> Ding Dinghua



-- 
Ding Dinghua