You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "hongbin ma (JIRA)" <ji...@apache.org> on 2016/09/07 13:15:22 UTC

[jira] [Commented] (KYLIN-1981) PK/FK derived will break for left join in some cases

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

hongbin ma commented on KYLIN-1981:
-----------------------------------

another kind of related issue is: (sql_raw/query26.sql)

for queries like 

select LSTG_FORMAT_NAME, LSTG_SITE_ID,SLR_SEGMENT_CD,test_kylin_fact.CAL_DT,test_category_groupings.LEAF_CATEG_ID,PRICE from test_kylin_fact left JOIN edw.test_cal_dt as test_cal_dt  ON test_kylin_fact.cal_dt = test_cal_dt.cal_dt left 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 left JOIN edw.test_sites as test_sites ON test_kylin_fact.lstg_site_id = test_sites.site_id 

the expected result looks like: (watch the null values, they exist because left join)

Others_B	3	5	2013-07-25	75708	719.1005	
Others_B	3	5	2013-07-30	null	745.4067	
Others_B	3	5	2013-08-31	null	671.7349	
Others_B	3	5	2013-11-30	null	781.5007	

however the actual output looks like:

Others_B	3	5	2013-07-25	75708	719.1005	
Others_B	3	5	2013-07-30	67698	745.4067	
Others_B	3	5	2013-08-31	106246	671.7349	
Others_B	3	5	2013-11-30	164261	781.5007	

> PK/FK derived will break for left join in some cases
> ----------------------------------------------------
>
>                 Key: KYLIN-1981
>                 URL: https://issues.apache.org/jira/browse/KYLIN-1981
>             Project: Kylin
>          Issue Type: Bug
>            Reporter: hongbin ma
>            Assignee: liyang
>            Priority: Minor
>
> for left join cubes. suppose A is the FK in fact table, and B is the PK in lookup table. query like below will end up with "more" results
> select B, count(*) from fact left join lookup group by B



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