You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kylin.apache.org by "PENG Zhengshuai (Jira)" <ji...@apache.org> on 2019/09/05 08:56:00 UTC

[jira] [Created] (KYLIN-4158) Query failed for GroupBy an expression of column with limit in SQL

PENG Zhengshuai created KYLIN-4158:
--------------------------------------

             Summary: Query failed for GroupBy an expression of column with limit in SQL
                 Key: KYLIN-4158
                 URL: https://issues.apache.org/jira/browse/KYLIN-4158
             Project: Kylin
          Issue Type: Bug
          Components: Query Engine
    Affects Versions: v2.6.2
            Reporter: PENG Zhengshuai
            Assignee: PENG Zhengshuai


Sql limit should not be pushdown to storage level if group by clause is an expression of columns.

For example:

{code:java}
SELECT (CASE WHEN ("TEST_KYLIN_FACT"."LSTG_FORMAT_NAME" IN ('Auction', 'FP-GTC')) THEN 'Auction' ELSE "TEST_KYLIN_FACT"."LSTG_FORMAT_NAME" END) AS "LSTG_FORMAT_NAME__group_",
  SUM("TEST_KYLIN_FACT"."PRICE") AS "sum_PRICE_ok"
FROM "TEST_KYLIN_FACT" "TEST_KYLIN_FACT"
GROUP BY (CASE WHEN ("TEST_KYLIN_FACT"."LSTG_FORMAT_NAME" IN ('Auction', 'FP-GTC')) THEN 'Auction' ELSE "TEST_KYLIN_FACT"."LSTG_FORMAT_NAME" END)
limit 4
{code}

In this SQL, group by clause is an expression, the limit should NOT be push-down to storage level, otherwise, the result is incorrect



--
This message was sent by Atlassian Jira
(v8.3.2#803003)