You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@kylin.apache.org by Billy Liu <bi...@apache.org> on 2016/12/27 08:41:48 UTC
Re: kylin query with case return error result
When you talk about mismatch result, you'd better provide the sample data
and actual result. Otherwise, nobody could reproduce your issue easily.
2016-12-27 16:13 GMT+08:00 徐 鹏 <xu...@outlook.com>:
> HI all:
> Query1:
> SELECT COUNT(DISTINCT CASE WHEN pagefiltername IN
> (‘homepage') THEN t.loginkey END) AS homepageuv
> FROM fly t
> WHERE yyyymmdd='20161222’
> Query2:
> SELECT COUNT(DISTINCT t.loginkey ) AS homepageuv FROM fly
> t WHERE yyyymmdd='20161222' and pagefiltername IN ('homepage') ;
>
> expected :Query1=Query2
> actual:Query1 !=Query2
>
> What’s wrong?
>
>
> Regards,
> Peng Xu
> xupeng1226@outlook.com
>
>
>
>
>
>
>
Re: kylin query with case return error result
Posted by Alberto Ramón <a....@gmail.com>.
See calcite syntaxis
<https://calcite.apache.org/docs/reference.html#aggregate-functions>
I think isnt allowed: Agg ( distinct case)
You can try with: Agg ( distinct value)
2016-12-27 9:41 GMT+01:00 Billy Liu <bi...@apache.org>:
> When you talk about mismatch result, you'd better provide the sample data
> and actual result. Otherwise, nobody could reproduce your issue easily.
>
> 2016-12-27 16:13 GMT+08:00 徐 鹏 <xu...@outlook.com>:
>
>> HI all:
>> Query1:
>> SELECT COUNT(DISTINCT CASE WHEN pagefiltername IN
>> (‘homepage') THEN t.loginkey END) AS homepageuv
>> FROM fly t
>> WHERE yyyymmdd='20161222’
>> Query2:
>> SELECT COUNT(DISTINCT t.loginkey ) AS homepageuv FROM fly
>> t WHERE yyyymmdd='20161222' and pagefiltername IN ('homepage') ;
>>
>> expected :Query1=Query2
>> actual:Query1 !=Query2
>>
>> What’s wrong?
>>
>>
>> Regards,
>> Peng Xu
>> xupeng1226@outlook.com
>>
>>
>>
>>
>>
>>
>>
>
>
>