Uploaded image for project: 'Kylin'
  1. Kylin
  2. KYLIN-4158

Query failed for GroupBy an expression of column with limit in SQL

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: v2.6.2
    • Fix Version/s: v3.0.0-beta, v2.6.4
    • Component/s: Query Engine
    • Labels:
      None

      Description

      When executing a sql query, the limit should not be pushdown to storage scan level if group by clause is an expression of columns.

      For example:

      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
      

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                PENG Zhengshuai PENG Zhengshuai
                Reporter:
                PENG Zhengshuai PENG Zhengshuai
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: