@Alex, support of the FILTER clause or the count_distinct_if() will be more complicated than you think. It is not just about measure type.
You can open a JIRA and collaborate there. On Sun, Sep 3, 2017 at 7:12 PM, Li Yang <[email protected]> wrote: > Kylin does not support FILTER clause as of 2.1 > > On Wed, Aug 30, 2017 at 3:06 PM, Julian Hyde <[email protected]> > wrote: > >> Are you aware of the FILTER clause? I believe that COUNT_DISTINCT_IF(x, >> b) is equivalent to COUNT(DISTINCT x) FILTER(WHERE b). And similarly >> COUNT_IF and SUM_IF. >> >> FILTER has been in Calcite for a while; I don't know whether it has made >> it into Kylin yet. >> >> Julian >> >> > On Aug 28, 2017, at 8:26 AM, Alexander Sterligov <[email protected]> >> wrote: >> > >> > Hi! >> > >> > I would like to add _if functions to kylin. Could you please help me. >> > >> > I already succeeded with count_distinct_if. It was quite easy because >> > intersect_count is very close to count_distinct_if, I only needed to >> make >> > 'factories' and 'udafMap' in MeasureTypeFactory to be multimaps. >> > >> > But I have problems with count_if, because BasicMeasureType doesn't have >> > any rewrite functions and implemented in a different way from other >> measure >> > types. There are already some dirty code to handle BasicMeasureType >> > functions and it looks like new hacks for count_if is not a good idea. >> It's >> > better to refactor it to be same for all types and implement count, sum, >> > min, max as rewrite functions. Am I right? >> > >> > >> > ---------- Forwarded message ---------- >> > From: Billy Liu <[email protected]> >> > Date: Mon, Aug 28, 2017 at 5:20 PM >> > Subject: Re: count_distinct_if, count_if and sum_if >> > To: user <[email protected]> >> > >> > >> > This kinds of contribution is very welcomed. Could you send your issue >> to >> > dev mailer, the community will help you. >> > >> > 2017-08-28 21:40 GMT+08:00 Alexander Sterligov <[email protected]>: >> > >> >> Hi! >> >> >> >> It would be nice to have if-functions in kylin. What do you think? >> >> >> >> I've already implemented count_distinct_if, but I have problems adding >> new >> >> functions for BasicMeasureType. >> >> >> >> Best regards, >> >> Alexander Sterligov >> >> >> > >
