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

Check for "ORDER BY LIMIT" clause when rewrite SUM query as TOPN

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • v3.0.0, v2.6.3
    • Measure - TopN
    • 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

        1. cube_desc.png
          31 kB
          Na Zhai
        2. sql.png
          38 kB
          Na Zhai

        Issue Links

          Activity

            No work has yet been logged on this issue.

            People

              Wayne0101 Chao Long
              jhg543 Lin Tingmao
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: