[jira] [Created] (KYLIN-2620) Check for "ORDER BY LIMIT" clause when rewrite SUM query as TOPN

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (KYLIN-2620) Check for "ORDER BY LIMIT" clause when rewrite SUM query as TOPN

JIRA jira@apache.org
Lin Tingmao created KYLIN-2620:
----------------------------------

             Summary: Check for "ORDER BY LIMIT" clause when rewrite SUM query as TOPN
                 Key: KYLIN-2620
                 URL: https://issues.apache.org/jira/browse/KYLIN-2620
             Project: Kylin
          Issue Type: Bug
            Reporter: Lin Tingmao


When running the following query

select sum(measure) from table group by col_id

if there exists TOPN(measure, group by col_id)  measure, TopNMeasureType.isTopNCompatibleSum()    will pass, so the SUM is rewritten to TOPN. This confuses the user since they may expect a accurate result for every distinct value of group by column(s).

Kylin should check if "ORDER BY col_id LIMIT topncapacity" is present in the query to determine whether to rewrite.



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