You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@kylin.apache.org by "Joanna He (Jingke He)" <ji...@kyligence.io> on 2017/07/25 01:41:35 UTC

Kylin window function

Anyone familiar with kylin window function? I am trying to get running total of past 12 months sales based on sql below and I am having difficulties getting the correct syntax.
The tech blog below mentioned kylin syntax follow calcite but on the calcite function page, it does not specify the syntax within the window.



select g.categ_lvl3_name
,c.month_id
,sum(price) as sales
from KYLIN_Sales s
join KYLIN_CAL_DT c
on s.part_dt=c.cal_dt
join KYLIN_CATEGORY_GROUPINGS g
on s.leaf_categ_id=g.leaf_categ_id
and s.LSTG_SITE_ID=g.SITE_ID
group  by g.categ_lvl3_name, month_id
order by g.categ_lvl3_name,month_id


何京珂
Joanna He


Re: Kylin window function

Posted by Li Yang <li...@apache.org>.
Some test queries:
https://github.com/apache/kylin/blob/master/kylin-it/src/test/resources/query/sql_window/query01.sql
https://github.com/apache/kylin/blob/master/kylin-it/src/test/resources/query/sql_window/query02.sql
https://github.com/apache/kylin/blob/master/kylin-it/src/test/resources/query/sql_window/query03.sql


On Tue, Jul 25, 2017 at 11:31 AM, Billy Liu <bi...@apache.org> wrote:

> + Yerui. Do you have any idea?
>
> 2017-07-25 11:25 GMT+08:00 Joanna He (Jingke He) <ji...@kyligence.io>:
>
>> The tech blog I referred.
>>
>> http://kylin.apache.org/blog/2016/11/16/window-function/
>>
>>
>>
>>
>>
>> 何京珂
>>
>> Joanna He
>>
>>
>>
>>
>>
>> *From: *"Joanna He (Jingke He)" <ji...@kyligence.io>
>> *Reply-To: *"user@kylin.apache.org" <us...@kylin.apache.org>
>> *Date: *Tuesday, 25 July 2017 at 9:41 AM
>> *To: *"user@kylin.apache.org" <us...@kylin.apache.org>
>> *Subject: *Kylin window function
>>
>>
>>
>> Anyone familiar with kylin window function? I am trying to get running
>> total of past 12 months sales based on sql below and I am having
>> difficulties getting the correct syntax.
>>
>> The tech blog below mentioned kylin syntax follow calcite but on the
>> calcite function page, it does not specify the syntax within the window.
>>
>>
>>
>>
>>
>>
>>
>> select g.categ_lvl3_name
>>
>> ,c.month_id
>>
>> ,sum(price) as sales
>>
>> from KYLIN_Sales s
>>
>> join KYLIN_CAL_DT c
>>
>> on s.part_dt=c.cal_dt
>>
>> join KYLIN_CATEGORY_GROUPINGS g
>>
>> on s.leaf_categ_id=g.leaf_categ_id
>>
>> and s.LSTG_SITE_ID=g.SITE_ID
>>
>> group  by g.categ_lvl3_name, month_id
>>
>> order by g.categ_lvl3_name,month_id
>>
>>
>>
>>
>>
>> 何京珂
>>
>> Joanna He
>>
>>
>>
>
>

Re: Kylin window function

Posted by Billy Liu <bi...@apache.org>.
+ Yerui. Do you have any idea?

2017-07-25 11:25 GMT+08:00 Joanna He (Jingke He) <ji...@kyligence.io>:

> The tech blog I referred.
>
> http://kylin.apache.org/blog/2016/11/16/window-function/
>
>
>
>
>
> 何京珂
>
> Joanna He
>
>
>
>
>
> *From: *"Joanna He (Jingke He)" <ji...@kyligence.io>
> *Reply-To: *"user@kylin.apache.org" <us...@kylin.apache.org>
> *Date: *Tuesday, 25 July 2017 at 9:41 AM
> *To: *"user@kylin.apache.org" <us...@kylin.apache.org>
> *Subject: *Kylin window function
>
>
>
> Anyone familiar with kylin window function? I am trying to get running
> total of past 12 months sales based on sql below and I am having
> difficulties getting the correct syntax.
>
> The tech blog below mentioned kylin syntax follow calcite but on the
> calcite function page, it does not specify the syntax within the window.
>
>
>
>
>
>
>
> select g.categ_lvl3_name
>
> ,c.month_id
>
> ,sum(price) as sales
>
> from KYLIN_Sales s
>
> join KYLIN_CAL_DT c
>
> on s.part_dt=c.cal_dt
>
> join KYLIN_CATEGORY_GROUPINGS g
>
> on s.leaf_categ_id=g.leaf_categ_id
>
> and s.LSTG_SITE_ID=g.SITE_ID
>
> group  by g.categ_lvl3_name, month_id
>
> order by g.categ_lvl3_name,month_id
>
>
>
>
>
> 何京珂
>
> Joanna He
>
>
>

Re: Kylin window function

Posted by "Joanna He (Jingke He)" <ji...@kyligence.io>.
The tech blog I referred.
http://kylin.apache.org/blog/2016/11/16/window-function/


何京珂
Joanna He


From: "Joanna He (Jingke He)" <ji...@kyligence.io>
Reply-To: "user@kylin.apache.org" <us...@kylin.apache.org>
Date: Tuesday, 25 July 2017 at 9:41 AM
To: "user@kylin.apache.org" <us...@kylin.apache.org>
Subject: Kylin window function

Anyone familiar with kylin window function? I am trying to get running total of past 12 months sales based on sql below and I am having difficulties getting the correct syntax.
The tech blog below mentioned kylin syntax follow calcite but on the calcite function page, it does not specify the syntax within the window.



select g.categ_lvl3_name
,c.month_id
,sum(price) as sales
from KYLIN_Sales s
join KYLIN_CAL_DT c
on s.part_dt=c.cal_dt
join KYLIN_CATEGORY_GROUPINGS g
on s.leaf_categ_id=g.leaf_categ_id
and s.LSTG_SITE_ID=g.SITE_ID
group  by g.categ_lvl3_name, month_id
order by g.categ_lvl3_name,month_id


何京珂
Joanna He