Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
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.
Attachments
Attachments
Issue Links
- is duplicated by
-
KYLIN-2011 Query without order by should not leverage topn measure
- Closed
- is related to
-
KYLIN-2617 SUM when rewritten as TOPN does not give consistent (correct) result?
- Open
- links to