Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-1860

INSERT OVERWRITE does not apply constant predicates

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • Impala 2.1.1
    • Impala 2.2
    • None

    Description

      A constant predicate that should prevent an INSERT from writing any rows is dropped.

      create table hp (col int) PARTITIONED BY (p int);
      
      [localhost:21000] > INSERT OVERWRITE hp PARTITION(p=2) SELECT id from functional.alltypes WHERE 1 = 0;
      Query: insert OVERWRITE hp PARTITION(p=2) SELECT id from functional.alltypes WHERE 1 = 0
      Inserted 7300 row(s) in 0.57s
      
      [localhost:21000] > EXPLAIN INSERT OVERWRITE hp PARTITION(p=2) SELECT id from functional.alltypes WHERE 1 = 0;
      Query: explain INSERT OVERWRITE hp PARTITION(p=2) SELECT id from functional.alltypes WHERE 1 = 0
      +------------------------------------------------------------------------------------+
      | Explain String                                                                     |
      +------------------------------------------------------------------------------------+
      | Estimated Per-Host Requirements: Memory=160.01MB VCores=1                          |
      | WARNING: The following tables are missing relevant table and/or column statistics. |
      | functional.alltypes                                                                |
      |                                                                                    |
      | F00:PLAN FRAGMENT [RANDOM]                                                         |
      |   WRITE TO HDFS [debug.hp, OVERWRITE=true, PARTITION-KEYS=(2)]                     |
      |   |  partitions=1                                                                  |
      |   |  hosts=3 per-host-mem=9.50KB                                                   |
      |   |                                                                                |
      |   00:SCAN HDFS [functional.alltypes, RANDOM]                                       |
      |      partitions=24/24 files=24 size=478.45KB                                       |
      |      table stats: 7300 rows total (24 partition(s) missing stats)                  |
      |      column stats: all                                                             |
      |      hosts=3 per-host-mem=160.00MB                                                 |
      |      tuple-ids=0 row-size=4B cardinality=7300                                      |
      +------------------------------------------------------------------------------------+
      

      Attachments

        Activity

          People

            alex.behm Alexander Behm
            henryr Henry Robinson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: