You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kylin.apache.org by "Dong Li (JIRA)" <ji...@apache.org> on 2016/05/12 01:51:13 UTC
[jira] [Created] (KYLIN-1682) Wrong cuboid is chosen when join with
subquery
Dong Li created KYLIN-1682:
------------------------------
Summary: Wrong cuboid is chosen when join with subquery
Key: KYLIN-1682
URL: https://issues.apache.org/jira/browse/KYLIN-1682
Project: Kylin
Issue Type: Bug
Components: Query Engine
Affects Versions: v1.5.1
Reporter: Dong Li
Assignee: liyang
Priority: Minor
In order to filter with top-n, tableau 9.2.6 will generate sql query like this:
SELECT KYLIN_SALES.LEAF_CATEG_ID ,"KYLIN_SALES"."LSTG_FORMAT_NAME" AS "LSTG_FORMAT_NAME", (CASE WHEN (NOT ("t0"."XTableau_join_flag" IS NULL)) THEN 1 WHEN NOT (NOT ("t0"."XTableau_join_flag" IS NULL)) THEN 0 ELSE NULL END) AS "io_Set_B_nk" FROM "DEFAULT"."KYLIN_SALES" "KYLIN_SALES" LEFT JOIN ( SELECT "KYLIN_SALES"."LSTG_FORMAT_NAME" AS "LSTG_FORMAT_NAME", COUNT(1) AS "XTableau_join_flag", SUM("KYLIN_SALES"."PRICE") AS "X__alias__A" FROM "DEFAULT"."KYLIN_SALES" "KYLIN_SALES" GROUP BY "KYLIN_SALES"."LSTG_FORMAT_NAME" ORDER BY 3 DESC LIMIT 2 ) "t0" ON (("KYLIN_SALES"."LSTG_FORMAT_NAME" = "t0"."LSTG_FORMAT_NAME") OR (("KYLIN_SALES"."LSTG_FORMAT_NAME" IS NULL) AND ("t0"."LSTG_FORMAT_NAME" IS NULL))) GROUP BY KYLIN_SALES.LEAF_CATEG_ID, "KYLIN_SALES"."LSTG_FORMAT_NAME", (CASE WHEN (NOT ("t0"."XTableau_join_flag" IS NULL)) THEN 1 WHEN NOT (NOT ("t0"."XTableau_join_flag" IS NULL)) THEN 0 ELSE NULL END)
There're 2 dimensions in this query: LEAF_CATEG_ID,LSTG_FORMAT_NAME, but the chosen cuboid is [2], which only contains LSTG_FORMAT_NAME.
So in the resultset, the LEAF_CATEG_ID column get empty values.
BTW, data set is from sample.sh - learn_kylin.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)