Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-16654

Optimize a combination of avg(), sum(), count(distinct) etc

Log workAgile BoardRank to TopRank to BottomVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 3.0.0
    • None
    • None

    Description

      an example rewrite for q28 of tpcds is

      (select LP as B1_LP ,CNT  as B1_CNT,CNTD as B1_CNTD
            from (select sum(xc0) / sum(xc1) as LP, sum(xc1) as CNT, count(1) as CNTD from (select sum(ss_list_price) as xc0, count(ss_list_price) as xc1 from store_sales  where 
      ss_list_price is not null and ss_quantity between 0 and 5
              and (ss_list_price between 11 and 11+10 
                   or ss_coupon_amt between 460 and 460+1000
                   or ss_wholesale_cost between 14 and 14+20)
       group by ss_list_price) ss0) ss1) B1
      

      Attachments

        1. HIVE-16654.01.patch
          72 kB
          Pengcheng Xiong
        2. HIVE-16654.02.patch
          217 kB
          Pengcheng Xiong
        3. HIVE-16654.03.patch
          186 kB
          Pengcheng Xiong
        4. HIVE-16654.04.patch
          207 kB
          Pengcheng Xiong

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            pxiong Pengcheng Xiong Assign to me
            pxiong Pengcheng Xiong
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Issue deployment