Luyuan Zhai created KYLIN-2258:
----------------------------------

             Summary: sql query(avg/min/max over) result turns to be replicated
                 Key: KYLIN-2258
                 URL: https://issues.apache.org/jira/browse/KYLIN-2258
             Project: Kylin
          Issue Type: Bug
          Components: Query Engine
         Environment: windows
            Reporter: Luyuan Zhai
            Assignee: liyang
            Priority: Minor


Situation: I inputed sql query following then results turned right yet with 
duplicates. It seems the over(partition by clause) doesn't work.

>>data source:learn_kylin
table kylin_sales looks like:
 
Row | TRANS_ID | PART_DT | LSTG_FORMAT_NAME | LEAF_CATEG_ID | LSTG_SITE_ID | 
SLR_SEGMENT_CD | PRICE | ITEM_COUNT | SELLER_ID | USER_ID | REGION |
| 1 | 0 | 2012-12-14 | Others | 88750 | 0 | 11 | 36.2828 | 0 | 10000349 | 
ANALYST | Beijing |


>>sql query like:
select LSTG_FORMAT_NAME, avg(price) over(partition by LSTG_FORMAT_NAME) as 
price_level, max(price) over(partition by LSTG_FORMAT_NAME) as price_max, 
min(price) over(partition by LSTG_FORMAT_NAME) as price_min from kylin_sales

>>results returns as: (you can find this file attached)
LSTG_FORMAT_NAME        PRICE_LEVEL     PRICE_MAX       PRICE_MIN
FP-non GTC      49.81376        145.495 0.0537
FP-non GTC      49.81376        145.495 0.0537
FP-non GTC      49.81376        145.495 0.0537
FP-non GTC      49.81376        145.495 0.0537
FP-non GTC      49.81376        145.495 0.0537
FP-non GTC      49.81376        145.495 0.0537
FP-non GTC      49.81376        145.495 0.0537
FP-non GTC      49.81376        145.495 0.0537
FP-non GTC      49.81376        145.495 0.0537
FP-non GTC      49.81376        145.495 0.0537
FP-non GTC      49.81376        145.495 0.0537
FP-non GTC      49.81376        145.495 0.0537
FP-non GTC      49.81376        145.495 0.0537
FP-non GTC      49.81376        145.495 0.0537
FP-non GTC      49.81376        145.495 0.0537
FP-non GTC      49.81376        145.495 0.0537
FP-non GTC      49.81376        145.495 0.0537




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to