You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kylin.apache.org by Li Yang <li...@apache.org> on 2017/03/11 01:04:07 UTC

Re: count(distinct case when condittion) &count(distinct) return same result

The behavior resembles KYLIN-2341. Still worth a new JIRA to track.

https://issues.apache.org/jira/browse/KYLIN-2500


On Thu, Mar 9, 2017 at 2:48 PM, Roy <aq...@163.com> wrote:

> Hi there,
>
> Use kylin insight submit below sentence,
> ------------------------------------------select
> sentence------------------------------------------
> select
> count(distinct memberid) as memberid,
> count(distinct case when issuccess=1 then memberid else -1 end) as
> Xmemberid
> from
> tables
> where istest=0 and isvalid=1  and createdate>='2017-03-08'
>
> results
> memberid   Xmemberid
>
> 863049        863049
> ------------------------------------
>
> retrun the same results,if add condittion include where the results is
> ------------------------------------------------------condittion in where
> ---------------------------------
> select
> count(distinct memberid) as Xmemberid
> from
> tables
> where istest=0 and isvalid=1 and issuccess=1 and createdate>='2017-03-08'
>
> results
> memberid
> 637290
> ----------------------------------
>
> Why  appear this problem,anyone has encountered a similar situcation?
>
> Best Regards
>
> Roy
>
>
>
>
>
>
>

Re: count(distinct case when condittion) &count(distinct) return same result

Posted by Alberto Ramón <a....@gmail.com>.
jaja, sorry

2017-03-11 8:14 GMT+00:00 Alberto Ramón <a....@gmail.com>:

> is this the same problem?
> https://issues.apache.org/jira/browse/KYLIN-2341
>
> 2017-03-11 1:04 GMT+00:00 Li Yang <li...@apache.org>:
>
>> The behavior resembles KYLIN-2341. Still worth a new JIRA to track.
>>
>> https://issues.apache.org/jira/browse/KYLIN-2500
>>
>>
>> On Thu, Mar 9, 2017 at 2:48 PM, Roy <aq...@163.com> wrote:
>>
>> > Hi there,
>> >
>> > Use kylin insight submit below sentence,
>> > ------------------------------------------select
>> > sentence------------------------------------------
>> > select
>> > count(distinct memberid) as memberid,
>> > count(distinct case when issuccess=1 then memberid else -1 end) as
>> > Xmemberid
>> > from
>> > tables
>> > where istest=0 and isvalid=1  and createdate>='2017-03-08'
>> >
>> > results
>> > memberid   Xmemberid
>> >
>> > 863049        863049
>> > ------------------------------------
>> >
>> > retrun the same results,if add condittion include where the results is
>> > ------------------------------------------------------condittion in
>> where
>> > ---------------------------------
>> > select
>> > count(distinct memberid) as Xmemberid
>> > from
>> > tables
>> > where istest=0 and isvalid=1 and issuccess=1 and
>> createdate>='2017-03-08'
>> >
>> > results
>> > memberid
>> > 637290
>> > ----------------------------------
>> >
>> > Why  appear this problem,anyone has encountered a similar situcation?
>> >
>> > Best Regards
>> >
>> > Roy
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>>
>
>

Re: count(distinct case when condittion) &count(distinct) return same result

Posted by Alberto Ramón <a....@gmail.com>.
is this the same problem?
https://issues.apache.org/jira/browse/KYLIN-2341

2017-03-11 1:04 GMT+00:00 Li Yang <li...@apache.org>:

> The behavior resembles KYLIN-2341. Still worth a new JIRA to track.
>
> https://issues.apache.org/jira/browse/KYLIN-2500
>
>
> On Thu, Mar 9, 2017 at 2:48 PM, Roy <aq...@163.com> wrote:
>
> > Hi there,
> >
> > Use kylin insight submit below sentence,
> > ------------------------------------------select
> > sentence------------------------------------------
> > select
> > count(distinct memberid) as memberid,
> > count(distinct case when issuccess=1 then memberid else -1 end) as
> > Xmemberid
> > from
> > tables
> > where istest=0 and isvalid=1  and createdate>='2017-03-08'
> >
> > results
> > memberid   Xmemberid
> >
> > 863049        863049
> > ------------------------------------
> >
> > retrun the same results,if add condittion include where the results is
> > ------------------------------------------------------condittion in
> where
> > ---------------------------------
> > select
> > count(distinct memberid) as Xmemberid
> > from
> > tables
> > where istest=0 and isvalid=1 and issuccess=1 and createdate>='2017-03-08'
> >
> > results
> > memberid
> > 637290
> > ----------------------------------
> >
> > Why  appear this problem,anyone has encountered a similar situcation?
> >
> > Best Regards
> >
> > Roy
> >
> >
> >
> >
> >
> >
> >
>