[jira] [Commented] (KYLIN-2313) Cannot find a cube in a subquery case with count distinct

2017-01-14 Thread liyang (JIRA)

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

liyang commented on KYLIN-2313:
---

Cannot reproduce. Tried below two queries on latest CI cube and sample cube 
(master branch). All turns out good.

{code}
SELECT p.cal_dt,
   p.lstg_site_id,
   p.grp,
   count(DISTINCT seller_id),
   sum(price)
FROM
  (SELECT t.cal_dt,
  t.lstg_site_id,
  t.seller_id,
  t.price,
  CASE t.lstg_format_name
  WHEN 'ABIN' THEN 'AAA'
  WHEN 'BBIN' THEN 'BBB'
  ELSE 'CCC'
  END AS grp
   FROM test_kylin_fact t) p
WHERE p.cal_dt=DATE'2013-01-01'
GROUP BY p.cal_dt,
 p.lstg_site_id,
 p.grp 
{code}

{code}
SELECT p.part_dt,
   p.lstg_site_id,
   p.grp,
   count(DISTINCT ops_user_id),
   sum(price)
FROM
  (SELECT t.part_dt,
  t.lstg_site_id,
  t.ops_user_id,
  t.price,
  CASE t.lstg_format_name
  WHEN 'ABIN' THEN 'AAA'
  WHEN 'BBIN' THEN 'BBB'
  ELSE 'CCC'
  END AS grp
   FROM kylin_sales t) p
WHERE p.part_dt=DATE'2013-01-01'
GROUP BY p.part_dt,
 p.lstg_site_id,
 p.grp 
{code}


> Cannot find a cube in a subquery case with count distinct
> -
>
> Key: KYLIN-2313
> URL: https://issues.apache.org/jira/browse/KYLIN-2313
> Project: Kylin
>  Issue Type: Bug
>  Components: Query Engine
>Affects Versions: v1.6.0
>Reporter: Dong Li
>Assignee: liyang
>Priority: Minor
> Fix For: v2.0.0
>
>
> With sample cube, 
> The first query can find a cube and give correct result:
> select p.part_dt, p.lstg_site_id, p.grp, count(distinct user_id), sum(price) 
> from (
> select t.part_dt, t.lstg_site_id, t.user_id, t.price,
> case t.lstg_format_name when 'ABIN' then 'AAA' when 'BBIN' then 'BBB' else 
> 'CCC' end as grp from kylin_sales t) p 
> group by p.part_dt, p.lstg_site_id, p.grp
> The second query will throw exception: cannot find any realization:
> select p.part_dt, p.lstg_site_id, p.grp, count(distinct user_id), sum(price) 
> from (
> select t.part_dt, t.lstg_site_id, t.user_id, t.price,
> case t.lstg_format_name when 'ABIN' then 'AAA'
> when 'BBIN' then 'BBB'
> else 'CCC' end as grp
> from kylin_sales t
> ) p 
> where p.part_dt=DATE'2013-01-01'
> group by p.part_dt, p.lstg_site_id, p.grp
> Error message:
> Error while executing SQL "select p.part_dt, p.lstg_site_id, p.grp, 
> count(distinct user_id), sum(price) from ( select t.part_dt, t.lstg_site_id, 
> t.user_id, t.price, case t.lstg_format_name when 'ABIN' then 'AAA' when 
> 'BBIN' then 'BBB' else 'CCC' end as grp from kylin_sales t ) p where 
> p.part_dt='2013-01-01' group by p.part_dt, p.lstg_site_id, p.grp LIMIT 
> 5": Can't find any realization. Please confirm with providers. SQL 
> digest: fact table DEFAULT.KYLIN_SALES,group by [DEFAULT.KYLIN_SALES.PART_DT, 
> DEFAULT.KYLIN_SALES.LSTG_SITE_ID, 
> UNKNOWN_MODEL:DEFAULT._KYLIN_TABLE.GRP],filter on 
> [DEFAULT.KYLIN_SALES.PART_DT],with aggregates[FunctionDesc 
> [expression=COUNT_DISTINCT, parameter=ParameterDesc [type=column, 
> value=USER_ID, nextParam=null], returnType=null], FunctionDesc 
> [expression=SUM, parameter=ParameterDesc [type=column, value=PRICE, 
> nextParam=null], returnType=null]].
> The difference between these 2 queries is: there's one condition in the 
> second query: where p.part_dt=DATE'2013-01-01'



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


[jira] [Commented] (KYLIN-2313) Cannot find a cube in a subquery case with count distinct

2016-12-22 Thread konglei (JIRA)

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

konglei commented on KYLIN-2313:


Please help me look at this problem. Thank you
https://issues.apache.org/jira/browse/KYLIN-2311

> Cannot find a cube in a subquery case with count distinct
> -
>
> Key: KYLIN-2313
> URL: https://issues.apache.org/jira/browse/KYLIN-2313
> Project: Kylin
>  Issue Type: Bug
>  Components: Query Engine
>Affects Versions: v1.6.0
>Reporter: Dong Li
>Assignee: liyang
>Priority: Minor
>
> With sample cube, 
> The first query can find a cube and give correct result:
> select p.part_dt, p.lstg_site_id, p.grp, count(distinct user_id), sum(price) 
> from (
> select t.part_dt, t.lstg_site_id, t.user_id, t.price,
> case t.lstg_format_name when 'ABIN' then 'AAA' when 'BBIN' then 'BBB' else 
> 'CCC' end as grp from kylin_sales t) p 
> group by p.part_dt, p.lstg_site_id, p.grp
> The second query will throw exception: cannot find any realization:
> select p.part_dt, p.lstg_site_id, p.grp, count(distinct user_id), sum(price) 
> from (
> select t.part_dt, t.lstg_site_id, t.user_id, t.price,
> case t.lstg_format_name when 'ABIN' then 'AAA'
> when 'BBIN' then 'BBB'
> else 'CCC' end as grp
> from kylin_sales t
> ) p 
> where p.part_dt=DATE'2013-01-01'
> group by p.part_dt, p.lstg_site_id, p.grp
> Error message:
> Error while executing SQL "select p.part_dt, p.lstg_site_id, p.grp, 
> count(distinct user_id), sum(price) from ( select t.part_dt, t.lstg_site_id, 
> t.user_id, t.price, case t.lstg_format_name when 'ABIN' then 'AAA' when 
> 'BBIN' then 'BBB' else 'CCC' end as grp from kylin_sales t ) p where 
> p.part_dt='2013-01-01' group by p.part_dt, p.lstg_site_id, p.grp LIMIT 
> 5": Can't find any realization. Please confirm with providers. SQL 
> digest: fact table DEFAULT.KYLIN_SALES,group by [DEFAULT.KYLIN_SALES.PART_DT, 
> DEFAULT.KYLIN_SALES.LSTG_SITE_ID, 
> UNKNOWN_MODEL:DEFAULT._KYLIN_TABLE.GRP],filter on 
> [DEFAULT.KYLIN_SALES.PART_DT],with aggregates[FunctionDesc 
> [expression=COUNT_DISTINCT, parameter=ParameterDesc [type=column, 
> value=USER_ID, nextParam=null], returnType=null], FunctionDesc 
> [expression=SUM, parameter=ParameterDesc [type=column, value=PRICE, 
> nextParam=null], returnType=null]].
> The difference between these 2 queries is: there's one condition in the 
> second query: where p.part_dt=DATE'2013-01-01'



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