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

Use Calcite to remove sections of a query plan known never produces rows

    XMLWordPrintableJSON

Details

    Description

      Calcite has a set of rules to remove sections of a query plan known never produces any rows. In some cases the whole plan can be removed. Such plans are represented with a single Values operators with no tuples. ex.:

      select y + 1 from (select a1 y, b1 z from t1 where b1 > 10) q WHERE 1=0
      
      HiveValues(tuples=[[]])
      

      Other cases when plan has outer join or set operators some branches can be replaced with empty values moving forward in some cases the join/set operator can be removed

      select a2, b2 from t2 where 1=0
      union
      select a1, b1 from t1
      
      HiveAggregate(group=[{0, 1}])
        HiveTableScan(table=[[default, t1]], table:alias=[t1])
      

      Attachments

        Issue Links

          Activity

            People

              kkasa Krisztian Kasa
              kkasa Krisztian Kasa
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 7h 40m
                  7h 40m