Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-12899 Bring query optimization time down
  3. HIVE-13806

Extension to folding NOT expressions in CBO

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.0
    • 2.1.0
    • CBO
    • None

    Description

      Follow-up of HIVE-13068.

      Extension to folding expressions for NOT.

      Currently, simplification is performed only if NOT is applied on a simple operation (e.g. IS NOT NULL, =, <>, etc.). We should take advantage of NOT distributivity when it is applied on OR/AND operations to try to simplify predicates further.

      Ex. ql/src/test/results/clientpositive/folder_predicate.q.out

      explain
      SELECT * FROM predicate_fold_tb WHERE not(value IS NOT NULL AND value = 3)
      

      Plan:

      STAGE DEPENDENCIES:
        Stage-1 is a root stage
        Stage-0 depends on stages: Stage-1
      
      STAGE PLANS:
        Stage: Stage-1
          Map Reduce
            Map Operator Tree:
                TableScan
                  alias: predicate_fold_tb
                  Statistics: Num rows: 6 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                  Filter Operator
                    predicate: (not (value is not null and (value = 3))) (type: boolean)
                    Statistics: Num rows: 3 Data size: 3 Basic stats: COMPLETE Column stats: NONE
                    Select Operator
                      expressions: value (type: int)
                      outputColumnNames: _col0
                      Statistics: Num rows: 3 Data size: 3 Basic stats: COMPLETE Column stats: NONE
                      File Output Operator
                        compressed: false
                        Statistics: Num rows: 3 Data size: 3 Basic stats: COMPLETE Column stats: NONE
                        table:
                            input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                            output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
                            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
      
        Stage: Stage-0
          Fetch Operator
            limit: -1
            Processor Tree:
              ListSink
      

      Attachments

        1. HIVE-13806.01.patch
          19 kB
          jcamachorodriguez
        2. HIVE-13806.patch
          10 kB
          jcamachorodriguez

        Issue Links

          Activity

            People

              jcamacho Jesús Camacho Rodríguez
              jcamacho Jesús Camacho Rodríguez
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: