You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kylin.apache.org by Vineet Mishra <cl...@gmail.com> on 2015/08/28 13:12:58 UTC

Kylin Cube build with Custom additional metric

Hi All,

I was curious to know whether can we create some additional metric(custom)
to the Kylin cube build.

So it would be something like an additional column which is made from
combination of some conditional and aggregate function.

COUNT(CASE WHEN so.ft = 'fv' THEN soi.sc ELSE NULL END) AS spo

Thanks!

Re: Kylin Cube build with Custom additional metric

Posted by Dayue Gao <da...@163.com>.
Hi Vineet,

We have the same requirements for more complex measures, among which a common one is "sum(if c1 == 1 then c2 else 0)". Currently Kylin doesn't support this kind of measure natively, however you can use Hive view as a workaround.

As for our company, we'd like to try the View approach first. If it still cannot fulfill our business demand, then we'll try to add complex measures support in Kylin.

Best Regard,
Dayue

> 在 2015年8月29日,上午1:26,Vineet Mishra <cl...@gmail.com> 写道:
> 
> Thanks guys!
> 
> Atleast we can have this rolled up in few upcoming releases! :)
> 
> On Fri, Aug 28, 2015 at 8:20 PM, Luke Han <lu...@gmail.com> wrote:
> 
>> Hi Vineet,
>>    Currently, custom measure is not supported yet.
>>    But by design, yes, it will be support, that's why I put "Expression"
>> not "Function" there;-)
>>    This is actually a common requirements, Dayue's company also has same
>> use case, the question is:
>> how complicate expression should to be supported? and then how about UDF?
>>    Dayue and I have discussed this last week when I'm in Beijing. He may
>> have more comments later.
>> 
>>    I have created KYLIN-976
>> <https://issues.apache.org/jira/browse/KYLIN-976> for tracking.
>> 
>>    Please leave your idea and discussion there.
>> 
>>    Thanks.
>> 
>> 
>> 
>> Best Regards!
>> ---------------------
>> 
>> Luke Han
>> 
>> On Fri, Aug 28, 2015 at 10:01 PM, Shi, Shaofeng <sh...@ebay.com> wrote:
>> 
>>> Kylin doesn¹t support custom function in measure; Usually we suggest user
>>> to achieve this by defining additional column in a hive view, and then
>> use
>>> the view as the fact table for cube building; That will make things easy;
>>> In eBay internal there are already several cases using this way;
>>> 
>>> On 8/28/15, 7:12 PM, "Vineet Mishra" <cl...@gmail.com> wrote:
>>> 
>>>> Hi All,
>>>> 
>>>> I was curious to know whether can we create some additional
>> metric(custom)
>>>> to the Kylin cube build.
>>>> 
>>>> So it would be something like an additional column which is made from
>>>> combination of some conditional and aggregate function.
>>>> 
>>>> COUNT(CASE WHEN so.ft = 'fv' THEN soi.sc ELSE NULL END) AS spo
>>>> 
>>>> Thanks!
>>> 
>>> 
>> 



Re: Kylin Cube build with Custom additional metric

Posted by Vineet Mishra <cl...@gmail.com>.
Thanks guys!

Atleast we can have this rolled up in few upcoming releases! :)

On Fri, Aug 28, 2015 at 8:20 PM, Luke Han <lu...@gmail.com> wrote:

> Hi Vineet,
>     Currently, custom measure is not supported yet.
>     But by design, yes, it will be support, that's why I put "Expression"
> not "Function" there;-)
>     This is actually a common requirements, Dayue's company also has same
> use case, the question is:
> how complicate expression should to be supported? and then how about UDF?
>     Dayue and I have discussed this last week when I'm in Beijing. He may
> have more comments later.
>
>     I have created KYLIN-976
> <https://issues.apache.org/jira/browse/KYLIN-976> for tracking.
>
>     Please leave your idea and discussion there.
>
>     Thanks.
>
>
>
> Best Regards!
> ---------------------
>
> Luke Han
>
> On Fri, Aug 28, 2015 at 10:01 PM, Shi, Shaofeng <sh...@ebay.com> wrote:
>
> > Kylin doesn¹t support custom function in measure; Usually we suggest user
> > to achieve this by defining additional column in a hive view, and then
> use
> > the view as the fact table for cube building; That will make things easy;
> > In eBay internal there are already several cases using this way;
> >
> > On 8/28/15, 7:12 PM, "Vineet Mishra" <cl...@gmail.com> wrote:
> >
> > >Hi All,
> > >
> > >I was curious to know whether can we create some additional
> metric(custom)
> > >to the Kylin cube build.
> > >
> > >So it would be something like an additional column which is made from
> > >combination of some conditional and aggregate function.
> > >
> > >COUNT(CASE WHEN so.ft = 'fv' THEN soi.sc ELSE NULL END) AS spo
> > >
> > >Thanks!
> >
> >
>

Re: Kylin Cube build with Custom additional metric

Posted by Luke Han <lu...@gmail.com>.
Hi Vineet,
    Currently, custom measure is not supported yet.
    But by design, yes, it will be support, that's why I put "Expression"
not "Function" there;-)
    This is actually a common requirements, Dayue's company also has same
use case, the question is:
how complicate expression should to be supported? and then how about UDF?
    Dayue and I have discussed this last week when I'm in Beijing. He may
have more comments later.

    I have created KYLIN-976
<https://issues.apache.org/jira/browse/KYLIN-976> for tracking.

    Please leave your idea and discussion there.

    Thanks.



Best Regards!
---------------------

Luke Han

On Fri, Aug 28, 2015 at 10:01 PM, Shi, Shaofeng <sh...@ebay.com> wrote:

> Kylin doesn¹t support custom function in measure; Usually we suggest user
> to achieve this by defining additional column in a hive view, and then use
> the view as the fact table for cube building; That will make things easy;
> In eBay internal there are already several cases using this way;
>
> On 8/28/15, 7:12 PM, "Vineet Mishra" <cl...@gmail.com> wrote:
>
> >Hi All,
> >
> >I was curious to know whether can we create some additional metric(custom)
> >to the Kylin cube build.
> >
> >So it would be something like an additional column which is made from
> >combination of some conditional and aggregate function.
> >
> >COUNT(CASE WHEN so.ft = 'fv' THEN soi.sc ELSE NULL END) AS spo
> >
> >Thanks!
>
>

Re: Kylin Cube build with Custom additional metric

Posted by "Shi, Shaofeng" <sh...@ebay.com>.
Kylin doesn¹t support custom function in measure; Usually we suggest user
to achieve this by defining additional column in a hive view, and then use
the view as the fact table for cube building; That will make things easy;
In eBay internal there are already several cases using this way;

On 8/28/15, 7:12 PM, "Vineet Mishra" <cl...@gmail.com> wrote:

>Hi All,
>
>I was curious to know whether can we create some additional metric(custom)
>to the Kylin cube build.
>
>So it would be something like an additional column which is made from
>combination of some conditional and aggregate function.
>
>COUNT(CASE WHEN so.ft = 'fv' THEN soi.sc ELSE NULL END) AS spo
>
>Thanks!