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

Xiaoyu Wang commented on KYLIN-1122:
------------------------------------

I merge the code into {{1.3.x}} and {{master}} branch.
IT tests is passed at the two branches!
For the 1.3.x branch. {{SQLDigest.isRawQuery}} is a little different with 
master branch:in 1.3.x branch,the {{metricColumns}} may be empty in some 
scenario like 
{noformat}
SELECT 
 sum(test_kylin_fact.price) as GMV 
 , count(*) as TRANS_CNT 
 FROM test_kylin_fact 
 inner JOIN edw.test_cal_dt as test_cal_dt 
 ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt 
 inner JOIN test_category_groupings 
 ON test_kylin_fact.leaf_categ_id = test_category_groupings.leaf_categ_id AND 
test_kylin_fact.lstg_site_id = test_category_groupings.site_id 
 inner JOIN edw.test_sites as test_sites 
 ON test_kylin_fact.lstg_site_id = test_sites.site_id 
 inner JOIN edw.test_seller_type_dim as test_seller_type_dim 
 ON test_kylin_fact.slr_segment_cd = test_seller_type_dim.seller_type_cd 
{noformat}

So I change to derive from both {{groupbyColumns}} and {{aggregations}}!

> Kylin support detail data query from fact table
> -----------------------------------------------
>
>                 Key: KYLIN-1122
>                 URL: https://issues.apache.org/jira/browse/KYLIN-1122
>             Project: Kylin
>          Issue Type: New Feature
>          Components: Query Engine
>    Affects Versions: v1.2
>            Reporter: Xiaoyu Wang
>            Assignee: liyang
>             Fix For: Backlog
>
>         Attachments: 
> 0001-KYLIN-1122-Kylin-support-detail-data-query-from-fact(2.x-staging).patch, 
> 0001-KYLIN-1122-Kylin-support-detail-data-query-from-fact(update-v2-1.x-staging).patch,
>  
> 0001-KYLIN-1122-Kylin-support-detail-data-query-from-fact-new-impl-under-refactoring-2.x-staging.patch
>
>
> Now Kylin does not support query correct detail rows from fact table like:
> select column1,column2,column3 from fact_table
> The jira KYLIN-1075 add the "SUM" function on the measure column if defined.
> But only the column number type is support.
> -I change some code to support this issue:-
> -Add a "VALUE" measure function : the same value and datatype in the input 
> and output of this function.-
> -If you want to query detail data from fact table-
> -*require*:-
> -1.Configure the column which not dimensions to "VALUE" or "SUM" measure.(If 
> not configure measure function in the column will get NULL value)-
> -2.The source table must has an unique value column and configure it as 
> dimension.-
> If you have the better solution please comment here.
> 2016-03-21:
> The final solution:
> Add a "RAW" measure function which return the list of all the value by one 
> key.
> If query detail data from fact table
> *require*:
> Configure the column to "RAW" measure.(If not configure measure function in 
> the column and do the RAW query will get the incorrect value!)



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

Reply via email to