[jira] [Commented] (KYLIN-4464) Query ... row_number over(order by c1) ... order by c2 ... get wrong order result

2020-06-16 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KYLIN-4464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17136439#comment-17136439
 ] 

ASF GitHub Bot commented on KYLIN-4464:
---

RupengWang commented on pull request #1198:
URL: https://github.com/apache/kylin/pull/1198#issuecomment-644620285


   ## Summary
   The results of These two test cases are correct.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Query ... row_number over(order by c1) ... order by c2 ... get wrong order 
> result
> -
>
> Key: KYLIN-4464
> URL: https://issues.apache.org/jira/browse/KYLIN-4464
> Project: Kylin
>  Issue Type: Bug
>  Components: Query Engine
>Reporter: Chao Long
>Assignee: Chao Long
>Priority: Major
> Fix For: v3.1.0, v3.0.2
>
> Attachments: image-2020-04-20-18-19-40-925.png, 
> image-2020-04-20-18-22-34-765.png, image-2020-05-07-10-32-39-983.png
>
>
> *SQL*
> {code:java}
> select t.*, row_number() over (order by t.lstg_format_name) as row_num from (
> select lstg_format_name, sum(price) as GMV from
> KYLIN_SALES
>   where lstg_format_name is not null
>    group by lstg_format_name
> ) as t
> order by t.GMV desc limit 5{quote}
> {code}
>  
> *Kylin result (order by lstg_format_name)*
>  !image-2020-04-20-18-19-40-925.png!
>   
>  *Calcite execution plan*
> {code:java}
> EXECUTION PLAN BEFORE REWRITE
> OLAPToEnumerableConverter
>   OLAPWindowRel(window#0=[window(partition {} order by [0 DESC] rows between 
> UNBOUNDED PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])], ctx=[], 
> groups=[[window(partition {} order by [0 DESC] rows between UNBOUNDED 
> PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])]])
> OLAPLimitRel(ctx=[], fetch=[5])
>   OLAPSortRel(sort0=[$1], dir0=[DESC], ctx=[])
> OLAPAggregateRel(group=[{0}], GMV=[SUM($1)], ctx=[])
>   OLAPProjectRel(LSTG_FORMAT_NAME=[$2], PRICE=[$5], ctx=[])
> OLAPFilterRel(condition=[IS NOT NULL($2)], ctx=[])
>   OLAPTableScan(table=[[DEFAULT, KYLIN_SALES]], ctx=[], 
> fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]])
> {code}
>  
> *Hive result(order by GMV)*
> !image-2020-04-20-18-22-34-765.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KYLIN-4464) Query ... row_number over(order by c1) ... order by c2 ... get wrong order result

2020-06-16 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KYLIN-4464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17136437#comment-17136437
 ] 

ASF GitHub Bot commented on KYLIN-4464:
---

RupengWang edited a comment on pull request #1198:
URL: https://github.com/apache/kylin/pull/1198#issuecomment-644609719


   ## Verify test case
    Case-1
   - Kylin Query Result
   
![image](https://user-images.githubusercontent.com/9884693/84750669-2d946a80-afee-11ea-8464-bfe1d8a8c967.png)
   
   - Hive Query Result
   
![image](https://user-images.githubusercontent.com/9884693/84749380-7b0fd800-afec-11ea-8d11-5a7819f2c6ec.png)
   
    Case-2
   - Kylin Query Result
   
![image](https://user-images.githubusercontent.com/9884693/84751246-ed81b780-afee-11ea-9daa-bacbfbbbca6d.png)
   
   - Hive Query Result
   
![image](https://user-images.githubusercontent.com/9884693/84751408-1f931980-afef-11ea-961c-b63b2888f12b.png)
   
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Query ... row_number over(order by c1) ... order by c2 ... get wrong order 
> result
> -
>
> Key: KYLIN-4464
> URL: https://issues.apache.org/jira/browse/KYLIN-4464
> Project: Kylin
>  Issue Type: Bug
>  Components: Query Engine
>Reporter: Chao Long
>Assignee: Chao Long
>Priority: Major
> Fix For: v3.1.0, v3.0.2
>
> Attachments: image-2020-04-20-18-19-40-925.png, 
> image-2020-04-20-18-22-34-765.png, image-2020-05-07-10-32-39-983.png
>
>
> *SQL*
> {code:java}
> select t.*, row_number() over (order by t.lstg_format_name) as row_num from (
> select lstg_format_name, sum(price) as GMV from
> KYLIN_SALES
>   where lstg_format_name is not null
>    group by lstg_format_name
> ) as t
> order by t.GMV desc limit 5{quote}
> {code}
>  
> *Kylin result (order by lstg_format_name)*
>  !image-2020-04-20-18-19-40-925.png!
>   
>  *Calcite execution plan*
> {code:java}
> EXECUTION PLAN BEFORE REWRITE
> OLAPToEnumerableConverter
>   OLAPWindowRel(window#0=[window(partition {} order by [0 DESC] rows between 
> UNBOUNDED PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])], ctx=[], 
> groups=[[window(partition {} order by [0 DESC] rows between UNBOUNDED 
> PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])]])
> OLAPLimitRel(ctx=[], fetch=[5])
>   OLAPSortRel(sort0=[$1], dir0=[DESC], ctx=[])
> OLAPAggregateRel(group=[{0}], GMV=[SUM($1)], ctx=[])
>   OLAPProjectRel(LSTG_FORMAT_NAME=[$2], PRICE=[$5], ctx=[])
> OLAPFilterRel(condition=[IS NOT NULL($2)], ctx=[])
>   OLAPTableScan(table=[[DEFAULT, KYLIN_SALES]], ctx=[], 
> fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]])
> {code}
>  
> *Hive result(order by GMV)*
> !image-2020-04-20-18-22-34-765.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KYLIN-4464) Query ... row_number over(order by c1) ... order by c2 ... get wrong order result

2020-06-16 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KYLIN-4464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17136435#comment-17136435
 ] 

ASF GitHub Bot commented on KYLIN-4464:
---

RupengWang edited a comment on pull request #1198:
URL: https://github.com/apache/kylin/pull/1198#issuecomment-644599963


   ## Design test cases
   
   ### Prepare test env
   - create cube and build segment (2012-01-01 ~ 2015-01-01)
   - make sure the sql like "Query ... row_number over(order by c1) ... order 
by c2"
   - compare 
   ### Case-1
   ```sql
   select t.*, row_number() over (order by t.lstg_format_name) as row_num from (
   select lstg_format_name, sum(price) as GMV from
   KYLIN_SALES
 where lstg_format_name is not null
  group by lstg_format_name
   ) as t
   order by t.GMV desc limit 5;
   ```
   1. Get Kylin result
   2. Get Hive result
   
   ### Case-2
   ```sql
   select tmp.*, row_number() over (order by tmp.LSTG_SITE_ID) as row_num from (
   select LSTG_SITE_ID, sum(price) as GMV from
   KYLIN_SALES
 where LSTG_SITE_ID is not null
  group by LSTG_SITE_ID
   ) as tmp
   order by tmp.GMV desc limit 5;
   ```
   1. Get Kylin result
   2. Get Hive result
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Query ... row_number over(order by c1) ... order by c2 ... get wrong order 
> result
> -
>
> Key: KYLIN-4464
> URL: https://issues.apache.org/jira/browse/KYLIN-4464
> Project: Kylin
>  Issue Type: Bug
>  Components: Query Engine
>Reporter: Chao Long
>Assignee: Chao Long
>Priority: Major
> Fix For: v3.1.0, v3.0.2
>
> Attachments: image-2020-04-20-18-19-40-925.png, 
> image-2020-04-20-18-22-34-765.png, image-2020-05-07-10-32-39-983.png
>
>
> *SQL*
> {code:java}
> select t.*, row_number() over (order by t.lstg_format_name) as row_num from (
> select lstg_format_name, sum(price) as GMV from
> KYLIN_SALES
>   where lstg_format_name is not null
>    group by lstg_format_name
> ) as t
> order by t.GMV desc limit 5{quote}
> {code}
>  
> *Kylin result (order by lstg_format_name)*
>  !image-2020-04-20-18-19-40-925.png!
>   
>  *Calcite execution plan*
> {code:java}
> EXECUTION PLAN BEFORE REWRITE
> OLAPToEnumerableConverter
>   OLAPWindowRel(window#0=[window(partition {} order by [0 DESC] rows between 
> UNBOUNDED PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])], ctx=[], 
> groups=[[window(partition {} order by [0 DESC] rows between UNBOUNDED 
> PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])]])
> OLAPLimitRel(ctx=[], fetch=[5])
>   OLAPSortRel(sort0=[$1], dir0=[DESC], ctx=[])
> OLAPAggregateRel(group=[{0}], GMV=[SUM($1)], ctx=[])
>   OLAPProjectRel(LSTG_FORMAT_NAME=[$2], PRICE=[$5], ctx=[])
> OLAPFilterRel(condition=[IS NOT NULL($2)], ctx=[])
>   OLAPTableScan(table=[[DEFAULT, KYLIN_SALES]], ctx=[], 
> fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]])
> {code}
>  
> *Hive result(order by GMV)*
> !image-2020-04-20-18-22-34-765.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KYLIN-4464) Query ... row_number over(order by c1) ... order by c2 ... get wrong order result

2020-06-16 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KYLIN-4464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17136429#comment-17136429
 ] 

ASF GitHub Bot commented on KYLIN-4464:
---

RupengWang edited a comment on pull request #1198:
URL: https://github.com/apache/kylin/pull/1198#issuecomment-644609719


   ## Verify test case
    Case-1
   - Kylin Query Result
   
![image](https://user-images.githubusercontent.com/9884693/84750669-2d946a80-afee-11ea-8464-bfe1d8a8c967.png)
   
   - Hive Query Result
   
![image](https://user-images.githubusercontent.com/9884693/84749380-7b0fd800-afec-11ea-8d11-5a7819f2c6ec.png)
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Query ... row_number over(order by c1) ... order by c2 ... get wrong order 
> result
> -
>
> Key: KYLIN-4464
> URL: https://issues.apache.org/jira/browse/KYLIN-4464
> Project: Kylin
>  Issue Type: Bug
>  Components: Query Engine
>Reporter: Chao Long
>Assignee: Chao Long
>Priority: Major
> Fix For: v3.1.0, v3.0.2
>
> Attachments: image-2020-04-20-18-19-40-925.png, 
> image-2020-04-20-18-22-34-765.png, image-2020-05-07-10-32-39-983.png
>
>
> *SQL*
> {code:java}
> select t.*, row_number() over (order by t.lstg_format_name) as row_num from (
> select lstg_format_name, sum(price) as GMV from
> KYLIN_SALES
>   where lstg_format_name is not null
>    group by lstg_format_name
> ) as t
> order by t.GMV desc limit 5{quote}
> {code}
>  
> *Kylin result (order by lstg_format_name)*
>  !image-2020-04-20-18-19-40-925.png!
>   
>  *Calcite execution plan*
> {code:java}
> EXECUTION PLAN BEFORE REWRITE
> OLAPToEnumerableConverter
>   OLAPWindowRel(window#0=[window(partition {} order by [0 DESC] rows between 
> UNBOUNDED PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])], ctx=[], 
> groups=[[window(partition {} order by [0 DESC] rows between UNBOUNDED 
> PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])]])
> OLAPLimitRel(ctx=[], fetch=[5])
>   OLAPSortRel(sort0=[$1], dir0=[DESC], ctx=[])
> OLAPAggregateRel(group=[{0}], GMV=[SUM($1)], ctx=[])
>   OLAPProjectRel(LSTG_FORMAT_NAME=[$2], PRICE=[$5], ctx=[])
> OLAPFilterRel(condition=[IS NOT NULL($2)], ctx=[])
>   OLAPTableScan(table=[[DEFAULT, KYLIN_SALES]], ctx=[], 
> fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]])
> {code}
>  
> *Hive result(order by GMV)*
> !image-2020-04-20-18-22-34-765.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KYLIN-4464) Query ... row_number over(order by c1) ... order by c2 ... get wrong order result

2020-06-16 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KYLIN-4464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17136422#comment-17136422
 ] 

ASF GitHub Bot commented on KYLIN-4464:
---

RupengWang commented on pull request #1198:
URL: https://github.com/apache/kylin/pull/1198#issuecomment-644609719


   ## Verify test case
    Case-1
   - Kylin Query Result
   
![image](https://user-images.githubusercontent.com/9884693/84748383-2881ec00-afeb-11ea-846b-e266998d35bf.png)
   - Hive Query Result
   
![image](https://user-images.githubusercontent.com/9884693/84749380-7b0fd800-afec-11ea-8d11-5a7819f2c6ec.png)
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Query ... row_number over(order by c1) ... order by c2 ... get wrong order 
> result
> -
>
> Key: KYLIN-4464
> URL: https://issues.apache.org/jira/browse/KYLIN-4464
> Project: Kylin
>  Issue Type: Bug
>  Components: Query Engine
>Reporter: Chao Long
>Assignee: Chao Long
>Priority: Major
> Fix For: v3.1.0, v3.0.2
>
> Attachments: image-2020-04-20-18-19-40-925.png, 
> image-2020-04-20-18-22-34-765.png, image-2020-05-07-10-32-39-983.png
>
>
> *SQL*
> {code:java}
> select t.*, row_number() over (order by t.lstg_format_name) as row_num from (
> select lstg_format_name, sum(price) as GMV from
> KYLIN_SALES
>   where lstg_format_name is not null
>    group by lstg_format_name
> ) as t
> order by t.GMV desc limit 5{quote}
> {code}
>  
> *Kylin result (order by lstg_format_name)*
>  !image-2020-04-20-18-19-40-925.png!
>   
>  *Calcite execution plan*
> {code:java}
> EXECUTION PLAN BEFORE REWRITE
> OLAPToEnumerableConverter
>   OLAPWindowRel(window#0=[window(partition {} order by [0 DESC] rows between 
> UNBOUNDED PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])], ctx=[], 
> groups=[[window(partition {} order by [0 DESC] rows between UNBOUNDED 
> PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])]])
> OLAPLimitRel(ctx=[], fetch=[5])
>   OLAPSortRel(sort0=[$1], dir0=[DESC], ctx=[])
> OLAPAggregateRel(group=[{0}], GMV=[SUM($1)], ctx=[])
>   OLAPProjectRel(LSTG_FORMAT_NAME=[$2], PRICE=[$5], ctx=[])
> OLAPFilterRel(condition=[IS NOT NULL($2)], ctx=[])
>   OLAPTableScan(table=[[DEFAULT, KYLIN_SALES]], ctx=[], 
> fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]])
> {code}
>  
> *Hive result(order by GMV)*
> !image-2020-04-20-18-22-34-765.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KYLIN-4464) Query ... row_number over(order by c1) ... order by c2 ... get wrong order result

2020-06-16 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KYLIN-4464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17136421#comment-17136421
 ] 

ASF GitHub Bot commented on KYLIN-4464:
---

RupengWang edited a comment on pull request #1198:
URL: https://github.com/apache/kylin/pull/1198#issuecomment-644599963


   ## Design test cases
   
   ### Prepare test env
   - create cube and build segment (2012-01-01 ~ 2015-01-01)
   - make sure the sql like "Query ... row_number over(order by c1) ... order 
by c2"
   - compare 
   ### Case-1
   ```sql
   select t.*, row_number() over (order by t.lstg_format_name) as row_num from (
   select lstg_format_name, sum(price) as GMV from
   KYLIN_SALES
 where lstg_format_name is not null
  group by lstg_format_name
   ) as t
   order by t.GMV desc limit 5;
   ```
   1. Get Kylin result
   2. Get Hive result
   
   ### Case-2
   ```sql
   
   ```
   1. Get Kylin result
   2. Get Hive result
   
   
   
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Query ... row_number over(order by c1) ... order by c2 ... get wrong order 
> result
> -
>
> Key: KYLIN-4464
> URL: https://issues.apache.org/jira/browse/KYLIN-4464
> Project: Kylin
>  Issue Type: Bug
>  Components: Query Engine
>Reporter: Chao Long
>Assignee: Chao Long
>Priority: Major
> Fix For: v3.1.0, v3.0.2
>
> Attachments: image-2020-04-20-18-19-40-925.png, 
> image-2020-04-20-18-22-34-765.png, image-2020-05-07-10-32-39-983.png
>
>
> *SQL*
> {code:java}
> select t.*, row_number() over (order by t.lstg_format_name) as row_num from (
> select lstg_format_name, sum(price) as GMV from
> KYLIN_SALES
>   where lstg_format_name is not null
>    group by lstg_format_name
> ) as t
> order by t.GMV desc limit 5{quote}
> {code}
>  
> *Kylin result (order by lstg_format_name)*
>  !image-2020-04-20-18-19-40-925.png!
>   
>  *Calcite execution plan*
> {code:java}
> EXECUTION PLAN BEFORE REWRITE
> OLAPToEnumerableConverter
>   OLAPWindowRel(window#0=[window(partition {} order by [0 DESC] rows between 
> UNBOUNDED PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])], ctx=[], 
> groups=[[window(partition {} order by [0 DESC] rows between UNBOUNDED 
> PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])]])
> OLAPLimitRel(ctx=[], fetch=[5])
>   OLAPSortRel(sort0=[$1], dir0=[DESC], ctx=[])
> OLAPAggregateRel(group=[{0}], GMV=[SUM($1)], ctx=[])
>   OLAPProjectRel(LSTG_FORMAT_NAME=[$2], PRICE=[$5], ctx=[])
> OLAPFilterRel(condition=[IS NOT NULL($2)], ctx=[])
>   OLAPTableScan(table=[[DEFAULT, KYLIN_SALES]], ctx=[], 
> fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]])
> {code}
>  
> *Hive result(order by GMV)*
> !image-2020-04-20-18-22-34-765.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KYLIN-4464) Query ... row_number over(order by c1) ... order by c2 ... get wrong order result

2020-06-16 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KYLIN-4464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17136420#comment-17136420
 ] 

ASF GitHub Bot commented on KYLIN-4464:
---

RupengWang commented on pull request #1198:
URL: https://github.com/apache/kylin/pull/1198#issuecomment-644608940


   ## Prepare data and env
   
   - [x] Built on commit_SHA : 33f191a1e7d5269e4bbf54f41e94a824c6687c24
   - [x] Hadoop env : CDH 5.7
   - [x] Just sample cube is OK.
   
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Query ... row_number over(order by c1) ... order by c2 ... get wrong order 
> result
> -
>
> Key: KYLIN-4464
> URL: https://issues.apache.org/jira/browse/KYLIN-4464
> Project: Kylin
>  Issue Type: Bug
>  Components: Query Engine
>Reporter: Chao Long
>Assignee: Chao Long
>Priority: Major
> Fix For: v3.1.0, v3.0.2
>
> Attachments: image-2020-04-20-18-19-40-925.png, 
> image-2020-04-20-18-22-34-765.png, image-2020-05-07-10-32-39-983.png
>
>
> *SQL*
> {code:java}
> select t.*, row_number() over (order by t.lstg_format_name) as row_num from (
> select lstg_format_name, sum(price) as GMV from
> KYLIN_SALES
>   where lstg_format_name is not null
>    group by lstg_format_name
> ) as t
> order by t.GMV desc limit 5{quote}
> {code}
>  
> *Kylin result (order by lstg_format_name)*
>  !image-2020-04-20-18-19-40-925.png!
>   
>  *Calcite execution plan*
> {code:java}
> EXECUTION PLAN BEFORE REWRITE
> OLAPToEnumerableConverter
>   OLAPWindowRel(window#0=[window(partition {} order by [0 DESC] rows between 
> UNBOUNDED PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])], ctx=[], 
> groups=[[window(partition {} order by [0 DESC] rows between UNBOUNDED 
> PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])]])
> OLAPLimitRel(ctx=[], fetch=[5])
>   OLAPSortRel(sort0=[$1], dir0=[DESC], ctx=[])
> OLAPAggregateRel(group=[{0}], GMV=[SUM($1)], ctx=[])
>   OLAPProjectRel(LSTG_FORMAT_NAME=[$2], PRICE=[$5], ctx=[])
> OLAPFilterRel(condition=[IS NOT NULL($2)], ctx=[])
>   OLAPTableScan(table=[[DEFAULT, KYLIN_SALES]], ctx=[], 
> fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]])
> {code}
>  
> *Hive result(order by GMV)*
> !image-2020-04-20-18-22-34-765.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KYLIN-4464) Query ... row_number over(order by c1) ... order by c2 ... get wrong order result

2020-06-16 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KYLIN-4464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17136413#comment-17136413
 ] 

ASF GitHub Bot commented on KYLIN-4464:
---

RupengWang edited a comment on pull request #1198:
URL: https://github.com/apache/kylin/pull/1198#issuecomment-644599963


   ## Design test cases
   
   ### Prepare test env
   - create cube and build segment (2012-01-01 ~ 2015-01-01)
   - make sure the sql like "Query ... row_number over(order by c1) ... order 
by c2"
   - compare 
   ### Case-1
   ```sql
   select t.*, row_number() over (order by t.lstg_format_name) as row_num from (
   select lstg_format_name, sum(price) as GMV from
   KYLIN_SALES
 where lstg_format_name is not null
  group by lstg_format_name
   ) as t
   order by t.GMV desc limit 5;
   ```
   1. Get Kylin result
   
![image](https://user-images.githubusercontent.com/9884693/84748383-2881ec00-afeb-11ea-846b-e266998d35bf.png)
   2. Get Hive result
   
![image](https://user-images.githubusercontent.com/9884693/84748393-2ae44600-afeb-11ea-86ed-c67ecd5ca5bd.png)
   
   ### Case-2
   ```sql
   
   ```
   1. Get Kylin result
   2. Get Hive result
   
   
   
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Query ... row_number over(order by c1) ... order by c2 ... get wrong order 
> result
> -
>
> Key: KYLIN-4464
> URL: https://issues.apache.org/jira/browse/KYLIN-4464
> Project: Kylin
>  Issue Type: Bug
>  Components: Query Engine
>Reporter: Chao Long
>Assignee: Chao Long
>Priority: Major
> Fix For: v3.1.0, v3.0.2
>
> Attachments: image-2020-04-20-18-19-40-925.png, 
> image-2020-04-20-18-22-34-765.png, image-2020-05-07-10-32-39-983.png
>
>
> *SQL*
> {code:java}
> select t.*, row_number() over (order by t.lstg_format_name) as row_num from (
> select lstg_format_name, sum(price) as GMV from
> KYLIN_SALES
>   where lstg_format_name is not null
>    group by lstg_format_name
> ) as t
> order by t.GMV desc limit 5{quote}
> {code}
>  
> *Kylin result (order by lstg_format_name)*
>  !image-2020-04-20-18-19-40-925.png!
>   
>  *Calcite execution plan*
> {code:java}
> EXECUTION PLAN BEFORE REWRITE
> OLAPToEnumerableConverter
>   OLAPWindowRel(window#0=[window(partition {} order by [0 DESC] rows between 
> UNBOUNDED PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])], ctx=[], 
> groups=[[window(partition {} order by [0 DESC] rows between UNBOUNDED 
> PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])]])
> OLAPLimitRel(ctx=[], fetch=[5])
>   OLAPSortRel(sort0=[$1], dir0=[DESC], ctx=[])
> OLAPAggregateRel(group=[{0}], GMV=[SUM($1)], ctx=[])
>   OLAPProjectRel(LSTG_FORMAT_NAME=[$2], PRICE=[$5], ctx=[])
> OLAPFilterRel(condition=[IS NOT NULL($2)], ctx=[])
>   OLAPTableScan(table=[[DEFAULT, KYLIN_SALES]], ctx=[], 
> fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]])
> {code}
>  
> *Hive result(order by GMV)*
> !image-2020-04-20-18-22-34-765.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KYLIN-4464) Query ... row_number over(order by c1) ... order by c2 ... get wrong order result

2020-06-16 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KYLIN-4464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17136408#comment-17136408
 ] 

ASF GitHub Bot commented on KYLIN-4464:
---

RupengWang commented on pull request #1198:
URL: https://github.com/apache/kylin/pull/1198#issuecomment-644599963


   ## Design test cases
   
   ### Prepare test env
   - create cube and build segment (2012-01-01 ~ 2013-01-01)
   - dimension : LSTG_FORMAT_NAME, ops_region, part_dt
   - measure : sum(price)
   
   ### Case-1



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Query ... row_number over(order by c1) ... order by c2 ... get wrong order 
> result
> -
>
> Key: KYLIN-4464
> URL: https://issues.apache.org/jira/browse/KYLIN-4464
> Project: Kylin
>  Issue Type: Bug
>  Components: Query Engine
>Reporter: Chao Long
>Assignee: Chao Long
>Priority: Major
> Fix For: v3.1.0, v3.0.2
>
> Attachments: image-2020-04-20-18-19-40-925.png, 
> image-2020-04-20-18-22-34-765.png, image-2020-05-07-10-32-39-983.png
>
>
> *SQL*
> {code:java}
> select t.*, row_number() over (order by t.lstg_format_name) as row_num from (
> select lstg_format_name, sum(price) as GMV from
> KYLIN_SALES
>   where lstg_format_name is not null
>    group by lstg_format_name
> ) as t
> order by t.GMV desc limit 5{quote}
> {code}
>  
> *Kylin result (order by lstg_format_name)*
>  !image-2020-04-20-18-19-40-925.png!
>   
>  *Calcite execution plan*
> {code:java}
> EXECUTION PLAN BEFORE REWRITE
> OLAPToEnumerableConverter
>   OLAPWindowRel(window#0=[window(partition {} order by [0 DESC] rows between 
> UNBOUNDED PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])], ctx=[], 
> groups=[[window(partition {} order by [0 DESC] rows between UNBOUNDED 
> PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])]])
> OLAPLimitRel(ctx=[], fetch=[5])
>   OLAPSortRel(sort0=[$1], dir0=[DESC], ctx=[])
> OLAPAggregateRel(group=[{0}], GMV=[SUM($1)], ctx=[])
>   OLAPProjectRel(LSTG_FORMAT_NAME=[$2], PRICE=[$5], ctx=[])
> OLAPFilterRel(condition=[IS NOT NULL($2)], ctx=[])
>   OLAPTableScan(table=[[DEFAULT, KYLIN_SALES]], ctx=[], 
> fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]])
> {code}
>  
> *Hive result(order by GMV)*
> !image-2020-04-20-18-22-34-765.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KYLIN-4464) Query ... row_number over(order by c1) ... order by c2 ... get wrong order result

2020-06-16 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KYLIN-4464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17136384#comment-17136384
 ] 

ASF GitHub Bot commented on KYLIN-4464:
---

RupengWang commented on pull request #1198:
URL: https://github.com/apache/kylin/pull/1198#issuecomment-644583694


   ### Check list
   - [x] Step 1. [**OPTIONAL**]Understand background/root cause/design 
basically(one hour EST) . Its issue type is 
   - [x] bug fix
   - [ ] new feature
   - [] enhancement
   - [x] Step 2. Test cases are designed and documented (30 minutes EST).
   - [x] Step 3. Prepare specific env, for example:
   - mock data (maybe some specific data type)
   - test env (maybe install a RDBMS instance).
   - [x] Step 4. Verify and make sure test cases passed.
   - [x] Step 5. Paste manual important steps and screenshots here (20 minutes 
EST). 
   - If you find difficulty in pick most important evidence, please attach 
diagnosis package. 
   - [x] Step 6. Do more check in user perspective (20 minutes EST)
   - [x] Doc need be updated? And if it is updated? Ask help for release 
manager if so.
   - [x] If it is a breaking change so we should notify Kylin community? 
Ask help for release manager if so.
   - [x] Step 7.  Summarize this test (20 minutes EST).
   
   ### Total estimate
   - 4 hours for small issue from optimistic estimate. 
   
   ### Note
   If you find some unexpected and **unrelated** error/mistake, please DO 
report it if it is truly a mistake, I think we may research and fix it in the 
future.
   
   If you find background information/root cause analysis is not complete or 
ambiguous, please try to contact to author or do a quick research and record 
what you find. It is a good chance to learn something interesting.
   
   If you find it is not easy to design testcase, please notify release manager.
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Query ... row_number over(order by c1) ... order by c2 ... get wrong order 
> result
> -
>
> Key: KYLIN-4464
> URL: https://issues.apache.org/jira/browse/KYLIN-4464
> Project: Kylin
>  Issue Type: Bug
>  Components: Query Engine
>Reporter: Chao Long
>Assignee: Chao Long
>Priority: Major
> Fix For: v3.1.0, v3.0.2
>
> Attachments: image-2020-04-20-18-19-40-925.png, 
> image-2020-04-20-18-22-34-765.png, image-2020-05-07-10-32-39-983.png
>
>
> *SQL*
> {code:java}
> select t.*, row_number() over (order by t.lstg_format_name) as row_num from (
> select lstg_format_name, sum(price) as GMV from
> KYLIN_SALES
>   where lstg_format_name is not null
>    group by lstg_format_name
> ) as t
> order by t.GMV desc limit 5{quote}
> {code}
>  
> *Kylin result (order by lstg_format_name)*
>  !image-2020-04-20-18-19-40-925.png!
>   
>  *Calcite execution plan*
> {code:java}
> EXECUTION PLAN BEFORE REWRITE
> OLAPToEnumerableConverter
>   OLAPWindowRel(window#0=[window(partition {} order by [0 DESC] rows between 
> UNBOUNDED PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])], ctx=[], 
> groups=[[window(partition {} order by [0 DESC] rows between UNBOUNDED 
> PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])]])
> OLAPLimitRel(ctx=[], fetch=[5])
>   OLAPSortRel(sort0=[$1], dir0=[DESC], ctx=[])
> OLAPAggregateRel(group=[{0}], GMV=[SUM($1)], ctx=[])
>   OLAPProjectRel(LSTG_FORMAT_NAME=[$2], PRICE=[$5], ctx=[])
> OLAPFilterRel(condition=[IS NOT NULL($2)], ctx=[])
>   OLAPTableScan(table=[[DEFAULT, KYLIN_SALES]], ctx=[], 
> fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]])
> {code}
>  
> *Hive result(order by GMV)*
> !image-2020-04-20-18-22-34-765.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KYLIN-4464) Query ... row_number over(order by c1) ... order by c2 ... get wrong order result

2020-06-16 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KYLIN-4464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17136385#comment-17136385
 ] 

ASF GitHub Bot commented on KYLIN-4464:
---

RupengWang edited a comment on pull request #1198:
URL: https://github.com/apache/kylin/pull/1198#issuecomment-644583694


   ### Check list
   - [x] Step 1. [**OPTIONAL**]Understand background/root cause/design 
basically(one hour EST) . Its issue type is 
   - [x] bug fix
   - [ ] new feature
   - [ ] enhancement
   - [x] Step 2. Test cases are designed and documented (30 minutes EST).
   - [x] Step 3. Prepare specific env, for example:
   - mock data (maybe some specific data type)
   - test env (maybe install a RDBMS instance).
   - [x] Step 4. Verify and make sure test cases passed.
   - [x] Step 5. Paste manual important steps and screenshots here (20 minutes 
EST). 
   - If you find difficulty in pick most important evidence, please attach 
diagnosis package. 
   - [x] Step 6. Do more check in user perspective (20 minutes EST)
   - [x] Doc need be updated? And if it is updated? Ask help for release 
manager if so.
   - [x] If it is a breaking change so we should notify Kylin community? 
Ask help for release manager if so.
   - [x] Step 7.  Summarize this test (20 minutes EST).
   
   ### Total estimate
   - 4 hours for small issue from optimistic estimate. 
   
   ### Note
   If you find some unexpected and **unrelated** error/mistake, please DO 
report it if it is truly a mistake, I think we may research and fix it in the 
future.
   
   If you find background information/root cause analysis is not complete or 
ambiguous, please try to contact to author or do a quick research and record 
what you find. It is a good chance to learn something interesting.
   
   If you find it is not easy to design testcase, please notify release manager.
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Query ... row_number over(order by c1) ... order by c2 ... get wrong order 
> result
> -
>
> Key: KYLIN-4464
> URL: https://issues.apache.org/jira/browse/KYLIN-4464
> Project: Kylin
>  Issue Type: Bug
>  Components: Query Engine
>Reporter: Chao Long
>Assignee: Chao Long
>Priority: Major
> Fix For: v3.1.0, v3.0.2
>
> Attachments: image-2020-04-20-18-19-40-925.png, 
> image-2020-04-20-18-22-34-765.png, image-2020-05-07-10-32-39-983.png
>
>
> *SQL*
> {code:java}
> select t.*, row_number() over (order by t.lstg_format_name) as row_num from (
> select lstg_format_name, sum(price) as GMV from
> KYLIN_SALES
>   where lstg_format_name is not null
>    group by lstg_format_name
> ) as t
> order by t.GMV desc limit 5{quote}
> {code}
>  
> *Kylin result (order by lstg_format_name)*
>  !image-2020-04-20-18-19-40-925.png!
>   
>  *Calcite execution plan*
> {code:java}
> EXECUTION PLAN BEFORE REWRITE
> OLAPToEnumerableConverter
>   OLAPWindowRel(window#0=[window(partition {} order by [0 DESC] rows between 
> UNBOUNDED PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])], ctx=[], 
> groups=[[window(partition {} order by [0 DESC] rows between UNBOUNDED 
> PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])]])
> OLAPLimitRel(ctx=[], fetch=[5])
>   OLAPSortRel(sort0=[$1], dir0=[DESC], ctx=[])
> OLAPAggregateRel(group=[{0}], GMV=[SUM($1)], ctx=[])
>   OLAPProjectRel(LSTG_FORMAT_NAME=[$2], PRICE=[$5], ctx=[])
> OLAPFilterRel(condition=[IS NOT NULL($2)], ctx=[])
>   OLAPTableScan(table=[[DEFAULT, KYLIN_SALES]], ctx=[], 
> fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]])
> {code}
>  
> *Hive result(order by GMV)*
> !image-2020-04-20-18-22-34-765.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KYLIN-4464) Query ... row_number over(order by c1) ... order by c2 ... get wrong order result

2020-05-22 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/KYLIN-4464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17113931#comment-17113931
 ] 

ASF subversion and git services commented on KYLIN-4464:


Commit e2cac72b16d5a446eccb9699a44414087f0fb00e in kylin's branch 
refs/heads/3.0.x from chao long
[ https://gitbox.apache.org/repos/asf?p=kylin.git;h=e2cac72 ]

KYLIN-4464 Not apply SortProjectTransposeRule when window func in projection


> Query ... row_number over(order by c1) ... order by c2 ... get wrong order 
> result
> -
>
> Key: KYLIN-4464
> URL: https://issues.apache.org/jira/browse/KYLIN-4464
> Project: Kylin
>  Issue Type: Bug
>  Components: Query Engine
>Reporter: Chao Long
>Assignee: Chao Long
>Priority: Major
> Fix For: v3.1.0
>
> Attachments: image-2020-04-20-18-19-40-925.png, 
> image-2020-04-20-18-22-34-765.png, image-2020-05-07-10-32-39-983.png
>
>
> *SQL*
> {code:java}
> select t.*, row_number() over (order by t.lstg_format_name) as row_num from (
> select lstg_format_name, sum(price) as GMV from
> KYLIN_SALES
>   where lstg_format_name is not null
>    group by lstg_format_name
> ) as t
> order by t.GMV desc limit 5{quote}
> {code}
>  
> *Kylin result (order by lstg_format_name)*
>  !image-2020-04-20-18-19-40-925.png!
>   
>  *Calcite execution plan*
> {code:java}
> EXECUTION PLAN BEFORE REWRITE
> OLAPToEnumerableConverter
>   OLAPWindowRel(window#0=[window(partition {} order by [0 DESC] rows between 
> UNBOUNDED PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])], ctx=[], 
> groups=[[window(partition {} order by [0 DESC] rows between UNBOUNDED 
> PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])]])
> OLAPLimitRel(ctx=[], fetch=[5])
>   OLAPSortRel(sort0=[$1], dir0=[DESC], ctx=[])
> OLAPAggregateRel(group=[{0}], GMV=[SUM($1)], ctx=[])
>   OLAPProjectRel(LSTG_FORMAT_NAME=[$2], PRICE=[$5], ctx=[])
> OLAPFilterRel(condition=[IS NOT NULL($2)], ctx=[])
>   OLAPTableScan(table=[[DEFAULT, KYLIN_SALES]], ctx=[], 
> fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]])
> {code}
>  
> *Hive result(order by GMV)*
> !image-2020-04-20-18-22-34-765.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KYLIN-4464) Query ... row_number over(order by c1) ... order by c2 ... get wrong order result

2020-05-22 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/KYLIN-4464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17113933#comment-17113933
 ] 

ASF subversion and git services commented on KYLIN-4464:


Commit d036da1bda725e7150b65e4eb387ddc0f22522f4 in kylin's branch 
refs/heads/2.6.x from chao long
[ https://gitbox.apache.org/repos/asf?p=kylin.git;h=d036da1 ]

KYLIN-4464 Not apply SortProjectTransposeRule when window func in projection


> Query ... row_number over(order by c1) ... order by c2 ... get wrong order 
> result
> -
>
> Key: KYLIN-4464
> URL: https://issues.apache.org/jira/browse/KYLIN-4464
> Project: Kylin
>  Issue Type: Bug
>  Components: Query Engine
>Reporter: Chao Long
>Assignee: Chao Long
>Priority: Major
> Fix For: v3.1.0, v3.0.2
>
> Attachments: image-2020-04-20-18-19-40-925.png, 
> image-2020-04-20-18-22-34-765.png, image-2020-05-07-10-32-39-983.png
>
>
> *SQL*
> {code:java}
> select t.*, row_number() over (order by t.lstg_format_name) as row_num from (
> select lstg_format_name, sum(price) as GMV from
> KYLIN_SALES
>   where lstg_format_name is not null
>    group by lstg_format_name
> ) as t
> order by t.GMV desc limit 5{quote}
> {code}
>  
> *Kylin result (order by lstg_format_name)*
>  !image-2020-04-20-18-19-40-925.png!
>   
>  *Calcite execution plan*
> {code:java}
> EXECUTION PLAN BEFORE REWRITE
> OLAPToEnumerableConverter
>   OLAPWindowRel(window#0=[window(partition {} order by [0 DESC] rows between 
> UNBOUNDED PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])], ctx=[], 
> groups=[[window(partition {} order by [0 DESC] rows between UNBOUNDED 
> PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])]])
> OLAPLimitRel(ctx=[], fetch=[5])
>   OLAPSortRel(sort0=[$1], dir0=[DESC], ctx=[])
> OLAPAggregateRel(group=[{0}], GMV=[SUM($1)], ctx=[])
>   OLAPProjectRel(LSTG_FORMAT_NAME=[$2], PRICE=[$5], ctx=[])
> OLAPFilterRel(condition=[IS NOT NULL($2)], ctx=[])
>   OLAPTableScan(table=[[DEFAULT, KYLIN_SALES]], ctx=[], 
> fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]])
> {code}
>  
> *Hive result(order by GMV)*
> !image-2020-04-20-18-22-34-765.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KYLIN-4464) Query ... row_number over(order by c1) ... order by c2 ... get wrong order result

2020-05-22 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KYLIN-4464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17113929#comment-17113929
 ] 

ASF GitHub Bot commented on KYLIN-4464:
---

shaofengshi merged pull request #1198:
URL: https://github.com/apache/kylin/pull/1198


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Query ... row_number over(order by c1) ... order by c2 ... get wrong order 
> result
> -
>
> Key: KYLIN-4464
> URL: https://issues.apache.org/jira/browse/KYLIN-4464
> Project: Kylin
>  Issue Type: Bug
>  Components: Query Engine
>Reporter: Chao Long
>Assignee: Chao Long
>Priority: Major
> Fix For: v3.1.0
>
> Attachments: image-2020-04-20-18-19-40-925.png, 
> image-2020-04-20-18-22-34-765.png, image-2020-05-07-10-32-39-983.png
>
>
> *SQL*
> {code:java}
> select t.*, row_number() over (order by t.lstg_format_name) as row_num from (
> select lstg_format_name, sum(price) as GMV from
> KYLIN_SALES
>   where lstg_format_name is not null
>    group by lstg_format_name
> ) as t
> order by t.GMV desc limit 5{quote}
> {code}
>  
> *Kylin result (order by lstg_format_name)*
>  !image-2020-04-20-18-19-40-925.png!
>   
>  *Calcite execution plan*
> {code:java}
> EXECUTION PLAN BEFORE REWRITE
> OLAPToEnumerableConverter
>   OLAPWindowRel(window#0=[window(partition {} order by [0 DESC] rows between 
> UNBOUNDED PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])], ctx=[], 
> groups=[[window(partition {} order by [0 DESC] rows between UNBOUNDED 
> PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])]])
> OLAPLimitRel(ctx=[], fetch=[5])
>   OLAPSortRel(sort0=[$1], dir0=[DESC], ctx=[])
> OLAPAggregateRel(group=[{0}], GMV=[SUM($1)], ctx=[])
>   OLAPProjectRel(LSTG_FORMAT_NAME=[$2], PRICE=[$5], ctx=[])
> OLAPFilterRel(condition=[IS NOT NULL($2)], ctx=[])
>   OLAPTableScan(table=[[DEFAULT, KYLIN_SALES]], ctx=[], 
> fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]])
> {code}
>  
> *Hive result(order by GMV)*
> !image-2020-04-20-18-22-34-765.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KYLIN-4464) Query ... row_number over(order by c1) ... order by c2 ... get wrong order result

2020-05-22 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/KYLIN-4464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17113930#comment-17113930
 ] 

ASF subversion and git services commented on KYLIN-4464:


Commit c5573dc9be7ad86b3a8c71bc4a17092594bdf8f9 in kylin's branch 
refs/heads/master from chao long
[ https://gitbox.apache.org/repos/asf?p=kylin.git;h=c5573dc ]

KYLIN-4464 Not apply SortProjectTransposeRule when window func in projection


> Query ... row_number over(order by c1) ... order by c2 ... get wrong order 
> result
> -
>
> Key: KYLIN-4464
> URL: https://issues.apache.org/jira/browse/KYLIN-4464
> Project: Kylin
>  Issue Type: Bug
>  Components: Query Engine
>Reporter: Chao Long
>Assignee: Chao Long
>Priority: Major
> Fix For: v3.1.0
>
> Attachments: image-2020-04-20-18-19-40-925.png, 
> image-2020-04-20-18-22-34-765.png, image-2020-05-07-10-32-39-983.png
>
>
> *SQL*
> {code:java}
> select t.*, row_number() over (order by t.lstg_format_name) as row_num from (
> select lstg_format_name, sum(price) as GMV from
> KYLIN_SALES
>   where lstg_format_name is not null
>    group by lstg_format_name
> ) as t
> order by t.GMV desc limit 5{quote}
> {code}
>  
> *Kylin result (order by lstg_format_name)*
>  !image-2020-04-20-18-19-40-925.png!
>   
>  *Calcite execution plan*
> {code:java}
> EXECUTION PLAN BEFORE REWRITE
> OLAPToEnumerableConverter
>   OLAPWindowRel(window#0=[window(partition {} order by [0 DESC] rows between 
> UNBOUNDED PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])], ctx=[], 
> groups=[[window(partition {} order by [0 DESC] rows between UNBOUNDED 
> PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])]])
> OLAPLimitRel(ctx=[], fetch=[5])
>   OLAPSortRel(sort0=[$1], dir0=[DESC], ctx=[])
> OLAPAggregateRel(group=[{0}], GMV=[SUM($1)], ctx=[])
>   OLAPProjectRel(LSTG_FORMAT_NAME=[$2], PRICE=[$5], ctx=[])
> OLAPFilterRel(condition=[IS NOT NULL($2)], ctx=[])
>   OLAPTableScan(table=[[DEFAULT, KYLIN_SALES]], ctx=[], 
> fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]])
> {code}
>  
> *Hive result(order by GMV)*
> !image-2020-04-20-18-22-34-765.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KYLIN-4464) Query ... row_number over(order by c1) ... order by c2 ... get wrong order result

2020-05-06 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KYLIN-4464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17101330#comment-17101330
 ] 

ASF GitHub Bot commented on KYLIN-4464:
---

coveralls commented on pull request #1198:
URL: https://github.com/apache/kylin/pull/1198#issuecomment-625000478


   ## Pull Request Test Coverage Report for [Build 
5885](https://coveralls.io/builds/30615077)
   
   * **0** of **8**   **(0.0%)**  changed or added relevant lines in **2** 
files are covered.
   * **8** unchanged lines in **3** files lost coverage.
   * Overall coverage decreased (**-0.006%**) to **27.32%**
   
   ---
   
   |  Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
   | :-|--||---: |
   | 
[query/src/main/java/org/apache/kylin/query/relnode/OLAPTableScan.java](https://coveralls.io/builds/30615077/source?filename=query%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fkylin%2Fquery%2Frelnode%2FOLAPTableScan.java#L218)
 | 0 | 2 | 0.0%
   | 
[query/src/main/java/org/apache/kylin/query/optrule/KylinSortProjectTransposeRule.java](https://coveralls.io/builds/30615077/source?filename=query%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fkylin%2Fquery%2Foptrule%2FKylinSortProjectTransposeRule.java#L30)
 | 0 | 6 | 0.0%
   
   
   |  Files with Coverage Reduction | New Missed Lines | % |
   | :-|--|--: |
   | 
[query/src/main/java/org/apache/kylin/query/relnode/OLAPTableScan.java](https://coveralls.io/builds/30615077/source?filename=query%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fkylin%2Fquery%2Frelnode%2FOLAPTableScan.java#L220)
 | 1 | 0% |
   | 
[stream-core/src/main/java/org/apache/kylin/stream/core/storage/CheckPointStore.java](https://coveralls.io/builds/30615077/source?filename=stream-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fkylin%2Fstream%2Fcore%2Fstorage%2FCheckPointStore.java#L98)
 | 2 | 73.74% |
   | 
[core-cube/src/main/java/org/apache/kylin/cube/inmemcubing/MemDiskStore.java](https://coveralls.io/builds/30615077/source?filename=core-cube%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fkylin%2Fcube%2Finmemcubing%2FMemDiskStore.java#L439)
 | 5 | 77.81% |
   
   
   |  Totals | [![Coverage 
Status](https://coveralls.io/builds/30615077/badge)](https://coveralls.io/builds/30615077)
 |
   | :-- | --: |
   | Change from base [Build 5884](https://coveralls.io/builds/30598965): |  
-0.006% |
   | Covered Lines: | 24348 |
   | Relevant Lines: | 89120 |
   
   ---
   #   - [Coveralls](https://coveralls.io)
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Query ... row_number over(order by c1) ... order by c2 ... get wrong order 
> result
> -
>
> Key: KYLIN-4464
> URL: https://issues.apache.org/jira/browse/KYLIN-4464
> Project: Kylin
>  Issue Type: Bug
>  Components: Query Engine
>Reporter: Chao Long
>Assignee: Chao Long
>Priority: Major
> Fix For: v3.0.2, v2.6.6
>
> Attachments: image-2020-04-20-18-19-40-925.png, 
> image-2020-04-20-18-22-34-765.png, image-2020-05-07-10-32-39-983.png
>
>
> *SQL*
> {code:java}
> select t.*, row_number() over (order by t.lstg_format_name) as row_num from (
> select lstg_format_name, sum(price) as GMV from
> KYLIN_SALES
>   where lstg_format_name is not null
>    group by lstg_format_name
> ) as t
> order by t.GMV desc limit 5{quote}
> {code}
>  
> *Kylin result (order by lstg_format_name)*
>  !image-2020-04-20-18-19-40-925.png!
>   
>  *Calcite execution plan*
> {code:java}
> EXECUTION PLAN BEFORE REWRITE
> OLAPToEnumerableConverter
>   OLAPWindowRel(window#0=[window(partition {} order by [0 DESC] rows between 
> UNBOUNDED PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])], ctx=[], 
> groups=[[window(partition {} order by [0 DESC] rows between UNBOUNDED 
> PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])]])
> OLAPLimitRel(ctx=[], fetch=[5])
>   OLAPSortRel(sort0=[$1], dir0=[DESC], ctx=[])
> OLAPAggregateRel(group=[{0}], GMV=[SUM($1)], ctx=[])
>   OLAPProjectRel(LSTG_FORMAT_NAME=[$2], PRICE=[$5], ctx=[])
> OLAPFilterRel(condition=[IS NOT NULL($2)], ctx=[])
>   OLAPTableScan(table=[[DEFAULT, KYLIN_SALES]], ctx=[], 
> fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]])
> {code}
>  
> *Hive result(order by GMV)*
> !image-2020-04-20-18-22-34-765.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KYLIN-4464) Query ... row_number over(order by c1) ... order by c2 ... get wrong order result

2020-05-06 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KYLIN-4464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17101327#comment-17101327
 ] 

ASF GitHub Bot commented on KYLIN-4464:
---

codecov-io commented on pull request #1198:
URL: https://github.com/apache/kylin/pull/1198#issuecomment-624999482


   # [Codecov](https://codecov.io/gh/apache/kylin/pull/1198?src=pr=h1) Report
   > Merging 
[#1198](https://codecov.io/gh/apache/kylin/pull/1198?src=pr=desc) into 
[master](https://codecov.io/gh/apache/kylin/commit/6b88e50a47a7e326eebc8d35836f1e17d43f4263=desc)
 will **decrease** coverage by `0.14%`.
   > The diff coverage is `0.00%`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/kylin/pull/1198/graphs/tree.svg?width=650=150=pr=JawVgbgsVo)](https://codecov.io/gh/apache/kylin/pull/1198?src=pr=tree)
   
   ```diff
   @@ Coverage Diff  @@
   ## master#1198  +/-   ##
   
   - Coverage 25.01%   24.86%   -0.15% 
   - Complexity 6257 6262   +5 
   
 Files  1449 1454   +5 
 Lines 8853389120 +587 
 Branches  1238112437  +56 
   
   + Hits  2215022164  +14 
   - Misses6421064775 +565 
   - Partials   2173 2181   +8 
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/kylin/pull/1198?src=pr=tree) | Coverage 
Δ | Complexity Δ | |
   |---|---|---|---|
   | 
[...n/query/optrule/KylinSortProjectTransposeRule.java](https://codecov.io/gh/apache/kylin/pull/1198/diff?src=pr=tree#diff-cXVlcnkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2t5bGluL3F1ZXJ5L29wdHJ1bGUvS3lsaW5Tb3J0UHJvamVjdFRyYW5zcG9zZVJ1bGUuamF2YQ==)
 | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
   | 
[.../org/apache/kylin/query/relnode/OLAPTableScan.java](https://codecov.io/gh/apache/kylin/pull/1198/diff?src=pr=tree#diff-cXVlcnkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2t5bGluL3F1ZXJ5L3JlbG5vZGUvT0xBUFRhYmxlU2Nhbi5qYXZh)
 | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | 
[...he/kylin/dict/lookup/cache/RocksDBLookupTable.java](https://codecov.io/gh/apache/kylin/pull/1198/diff?src=pr=tree#diff-Y29yZS1kaWN0aW9uYXJ5L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reWxpbi9kaWN0L2xvb2t1cC9jYWNoZS9Sb2Nrc0RCTG9va3VwVGFibGUuamF2YQ==)
 | `72.97% <0.00%> (-5.41%)` | `6.00% <0.00%> (-1.00%)` | |
   | 
[...org/apache/kylin/rest/util/QueryRequestLimits.java](https://codecov.io/gh/apache/kylin/pull/1198/diff?src=pr=tree#diff-c2VydmVyLWJhc2Uvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2t5bGluL3Jlc3QvdXRpbC9RdWVyeVJlcXVlc3RMaW1pdHMuamF2YQ==)
 | `35.71% <0.00%> (-4.77%)` | `5.00% <0.00%> (-1.00%)` | |
   | 
[...ream/core/storage/columnar/ColumnarStoreCache.java](https://codecov.io/gh/apache/kylin/pull/1198/diff?src=pr=tree#diff-c3RyZWFtLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2t5bGluL3N0cmVhbS9jb3JlL3N0b3JhZ2UvY29sdW1uYXIvQ29sdW1uYXJTdG9yZUNhY2hlLmphdmE=)
 | `52.27% <0.00%> (-3.41%)` | `8.00% <0.00%> (ø%)` | |
   | 
[...che/kylin/stream/core/storage/CheckPointStore.java](https://codecov.io/gh/apache/kylin/pull/1198/diff?src=pr=tree#diff-c3RyZWFtLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2t5bGluL3N0cmVhbS9jb3JlL3N0b3JhZ2UvQ2hlY2tQb2ludFN0b3JlLmphdmE=)
 | `63.63% <0.00%> (-3.04%)` | `21.00% <0.00%> (-1.00%)` | |
   | 
[.../apache/kylin/cube/cuboid/TreeCuboidScheduler.java](https://codecov.io/gh/apache/kylin/pull/1198/diff?src=pr=tree#diff-Y29yZS1jdWJlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reWxpbi9jdWJlL2N1Ym9pZC9UcmVlQ3Vib2lkU2NoZWR1bGVyLmphdmE=)
 | `63.84% <0.00%> (-2.31%)` | `0.00% <0.00%> (ø%)` | |
   | 
[...rg/apache/kylin/cube/inmemcubing/MemDiskStore.java](https://codecov.io/gh/apache/kylin/pull/1198/diff?src=pr=tree#diff-Y29yZS1jdWJlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reWxpbi9jdWJlL2lubWVtY3ViaW5nL01lbURpc2tTdG9yZS5qYXZh)
 | `69.30% <0.00%> (-1.83%)` | `7.00% <0.00%> (ø%)` | |
   | 
[...a/org/apache/kylin/dict/Number2BytesConverter.java](https://codecov.io/gh/apache/kylin/pull/1198/diff?src=pr=tree#diff-Y29yZS1kaWN0aW9uYXJ5L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9reWxpbi9kaWN0L051bWJlcjJCeXRlc0NvbnZlcnRlci5qYXZh)
 | `81.74% <0.00%> (-0.80%)` | `17.00% <0.00%> (-1.00%)` | |
   | 
[.../java/org/apache/kylin/common/util/StringUtil.java](https://codecov.io/gh/apache/kylin/pull/1198/diff?src=pr=tree#diff-Y29yZS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2t5bGluL2NvbW1vbi91dGlsL1N0cmluZ1V0aWwuamF2YQ==)
 | `40.81% <0.00%> (-0.43%)` | `22.00% <0.00%> (ø%)` | |
   | ... and [18 
more](https://codecov.io/gh/apache/kylin/pull/1198/diff?src=pr=tree-more) | |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/kylin/pull/1198?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing 

[jira] [Commented] (KYLIN-4464) Query ... row_number over(order by c1) ... order by c2 ... get wrong order result

2020-05-06 Thread Chao Long (Jira)


[ 
https://issues.apache.org/jira/browse/KYLIN-4464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17101321#comment-17101321
 ] 

Chao Long commented on KYLIN-4464:
--

*Test Evidence*

*After fix*

*Kylin result (order by lstg_format_name)***

*!image-2020-05-07-10-32-39-983.png!*

*Calcite execution plan***
{code:java}
EXECUTION PLAN BEFORE REWRITE
OLAPToEnumerableConverter
  OLAPLimitRel(ctx=[], fetch=[5])
OLAPSortRel(sort0=[$1], dir0=[DESC], ctx=[])
  OLAPWindowRel(window#0=[window(partition {} order by [0] rows between 
UNBOUNDED PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])], ctx=[], 
groups=[[window(partition {} order by [0] rows between UNBOUNDED PRECEDING and 
CURRENT ROW aggs [ROW_NUMBER()])]])
OLAPAggregateRel(group=[{0}], GMV=[SUM($1)], ctx=[])
  OLAPProjectRel(LSTG_FORMAT_NAME=[$2], PRICE=[$5], ctx=[])
OLAPFilterRel(condition=[IS NOT NULL($2)], ctx=[])
  OLAPTableScan(table=[[DEFAULT, KYLIN_SALES]], ctx=[], fields=[[0, 
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]])
{code}
 

> Query ... row_number over(order by c1) ... order by c2 ... get wrong order 
> result
> -
>
> Key: KYLIN-4464
> URL: https://issues.apache.org/jira/browse/KYLIN-4464
> Project: Kylin
>  Issue Type: Bug
>  Components: Query Engine
>Reporter: Chao Long
>Assignee: Chao Long
>Priority: Major
> Fix For: v3.0.2, v2.6.6
>
> Attachments: image-2020-04-20-18-19-40-925.png, 
> image-2020-04-20-18-22-34-765.png, image-2020-05-07-10-32-39-983.png
>
>
> *SQL*
> {code:java}
> select t.*, row_number() over (order by t.lstg_format_name) as row_num from (
> select lstg_format_name, sum(price) as GMV from
> KYLIN_SALES
>   where lstg_format_name is not null
>    group by lstg_format_name
> ) as t
> order by t.GMV desc limit 5{quote}
> {code}
>  
> *Kylin result (order by lstg_format_name)*
>  !image-2020-04-20-18-19-40-925.png!
>   
>  *Calcite execution plan*
> {code:java}
> EXECUTION PLAN BEFORE REWRITE
> OLAPToEnumerableConverter
>   OLAPWindowRel(window#0=[window(partition {} order by [0 DESC] rows between 
> UNBOUNDED PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])], ctx=[], 
> groups=[[window(partition {} order by [0 DESC] rows between UNBOUNDED 
> PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])]])
> OLAPLimitRel(ctx=[], fetch=[5])
>   OLAPSortRel(sort0=[$1], dir0=[DESC], ctx=[])
> OLAPAggregateRel(group=[{0}], GMV=[SUM($1)], ctx=[])
>   OLAPProjectRel(LSTG_FORMAT_NAME=[$2], PRICE=[$5], ctx=[])
> OLAPFilterRel(condition=[IS NOT NULL($2)], ctx=[])
>   OLAPTableScan(table=[[DEFAULT, KYLIN_SALES]], ctx=[], 
> fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]])
> {code}
>  
> *Hive result(order by GMV)*
> !image-2020-04-20-18-22-34-765.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (KYLIN-4464) Query ... row_number over(order by c1) ... order by c2 ... get wrong order result

2020-05-06 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/KYLIN-4464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17101320#comment-17101320
 ] 

ASF GitHub Bot commented on KYLIN-4464:
---

Wayne1c opened a new pull request #1198:
URL: https://github.com/apache/kylin/pull/1198


   …jection
   
   ## Proposed changes
   
   Describe the big picture of your changes here to communicate to the 
maintainers why we should accept this pull request. If it fixes a bug or 
resolves a feature request, be sure to link to that issue.
   
   ## Types of changes
   
   What types of changes does your code introduce to Kylin?
   _Put an `x` in the boxes that apply_
   
   - [ ] Bugfix (non-breaking change which fixes an issue)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to not work as expected)
   - [ ] Documentation Update (if none of the other choices apply)
   
   ## Checklist
   
   _Put an `x` in the boxes that apply. You can also fill these out after 
creating the PR. If you're unsure about any of them, don't hesitate to ask. 
We're here to help! This is simply a reminder of what we are going to look for 
before merging your code._
   
   - [ ] I have create an issue on [Kylin's 
jira](https://issues.apache.org/jira/browse/KYLIN), and have described the 
bug/feature there in detail
   - [ ] Commit messages in my PR start with the related jira ID, like 
"KYLIN- Make Kylin project open-source"
   - [ ] Compiling and unit tests pass locally with my changes
   - [ ] I have added tests that prove my fix is effective or that my feature 
works
   - [ ] If this change need a document change, I will prepare another pr 
against the `document` branch
   - [ ] Any dependent changes have been merged
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at 
user@kylin or dev@kylin by explaining why you chose the solution you did and 
what alternatives you considered, etc...
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Query ... row_number over(order by c1) ... order by c2 ... get wrong order 
> result
> -
>
> Key: KYLIN-4464
> URL: https://issues.apache.org/jira/browse/KYLIN-4464
> Project: Kylin
>  Issue Type: Bug
>  Components: Query Engine
>Reporter: Chao Long
>Assignee: Chao Long
>Priority: Major
> Fix For: v3.0.2, v2.6.6
>
> Attachments: image-2020-04-20-18-19-40-925.png, 
> image-2020-04-20-18-22-34-765.png
>
>
> *SQL*
> {code:java}
> select t.*, row_number() over (order by t.lstg_format_name) as row_num from (
> select lstg_format_name, sum(price) as GMV from
> KYLIN_SALES
>   where lstg_format_name is not null
>    group by lstg_format_name
> ) as t
> order by t.GMV desc limit 5{quote}
> {code}
>  
> *Kylin result (order by lstg_format_name)*
>  !image-2020-04-20-18-19-40-925.png!
>   
>  *Calcite execution plan*
> {code:java}
> EXECUTION PLAN BEFORE REWRITE
> OLAPToEnumerableConverter
>   OLAPWindowRel(window#0=[window(partition {} order by [0 DESC] rows between 
> UNBOUNDED PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])], ctx=[], 
> groups=[[window(partition {} order by [0 DESC] rows between UNBOUNDED 
> PRECEDING and CURRENT ROW aggs [ROW_NUMBER()])]])
> OLAPLimitRel(ctx=[], fetch=[5])
>   OLAPSortRel(sort0=[$1], dir0=[DESC], ctx=[])
> OLAPAggregateRel(group=[{0}], GMV=[SUM($1)], ctx=[])
>   OLAPProjectRel(LSTG_FORMAT_NAME=[$2], PRICE=[$5], ctx=[])
> OLAPFilterRel(condition=[IS NOT NULL($2)], ctx=[])
>   OLAPTableScan(table=[[DEFAULT, KYLIN_SALES]], ctx=[], 
> fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]])
> {code}
>  
> *Hive result(order by GMV)*
> !image-2020-04-20-18-22-34-765.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)