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 2017/05/01 12:56:04 UTC

[jira] [Resolved] (KYLIN-2579) Improvement on subqueries: reorder subqueries joins with RelOptRule

     [ https://issues.apache.org/jira/browse/KYLIN-2579?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

hongbin ma resolved KYLIN-2579.
-------------------------------
       Resolution: Fixed
    Fix Version/s: v2.1.0

> Improvement on subqueries: reorder subqueries joins with RelOptRule
> -------------------------------------------------------------------
>
>                 Key: KYLIN-2579
>                 URL: https://issues.apache.org/jira/browse/KYLIN-2579
>             Project: Kylin
>          Issue Type: Improvement
>            Reporter: hongbin ma
>            Assignee: hongbin ma
>             Fix For: v2.1.0
>
>
> Current support for subqueries has some limitations. for example, we require  JOIN on tables precedes JOIN on all subqueries, the following query:
> {code:sql}
> select test_kylin_fact.lstg_format_name,sum(test_kylin_fact.price) as GMV 
>  , count(*) as TRANS_CNT
>  from  
>  test_kylin_fact
>  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 (select cal_dt,week_beg_dt from edw.test_cal_dt  where week_beg_dt >= DATE '2010-02-10'  ) xxx
>  ON test_kylin_fact.cal_dt = xxx.cal_dt 
>  
>  
>  where test_category_groupings.meta_categ_name  <> 'Baby'
>  group by test_kylin_fact.lstg_format_name
> {code}
> works but 
> {code:sql}
> select test_kylin_fact.lstg_format_name,sum(test_kylin_fact.price) as GMV 
>  , count(*) as TRANS_CNT
>  from  
>  test_kylin_fact
>  inner JOIN (select cal_dt,week_beg_dt from edw.test_cal_dt  where week_beg_dt >= DATE '2010-02-10'  ) xxx
>  ON test_kylin_fact.cal_dt = xxx.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 
>  
>  
>  where test_category_groupings.meta_categ_name  <> 'Baby'
>  group by test_kylin_fact.lstg_format_name
> {code}
> won't work. In this JIRA we'll reroder subqueries joins with RelOptRule



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)