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

Limit should not be pushed down when group by an expression

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: v2.5.2
    • Fix Version/s: None
    • Component/s: Query Engine
    • Labels:
      None

      Description

      For example:

      SELECT case when hk_optime-hk_createtime <60 then 1 when hk_optime-hk_createtime <300 then 2 when hk_optime-hk_createtime <900 then 3 else 4 end,count(1)
      FROM temp_nativeapp_tblQuestion_dayinc
      WHERE dt = '20181223'
      AND hk_optime != 0
      and hk_createtime>1545494400
      group by case when hk_optime-hk_createtime <60 then 1 when hk_optime-hk_createtime <300 then 2 when hk_optime-hk_createtime <900 then 3 else 4 end

       

      when i use the choose the limit , the result is wrong.

      but i cancle the limit ,the result is rigth.

       

      when i use the  purely column "hk_delay" , "hk_delay" is same the expression "hk_optime-hk_createtime" .limit is not impact  the result.

        Attachments

        1. image-2018-12-28-12-15-37-539.png
          118 kB
          meizhennan
        2. image-2018-12-28-12-09-37-507.png
          118 kB
          meizhennan
        3. image-2018-12-28-12-04-20-536.png
          123 kB
          meizhennan

          Activity

            People

            • Assignee:
              hit_lacus Xiaoxiang Yu
              Reporter:
              meizhennan meizhennan
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: