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

Can not drop a default partition __HIVE_DEFAULT_PARTITION__ which is not a "string" type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.1.0
    • 2.3.0
    • Parser
    • None

    Description

      When partition is not a string type, for example, if it is a int type, when drop the default partition _HIVE_DEFAULT_PARTITION_, you will get:
      SemanticException Unexpected unknown partitions
      Reproduce:

      SET hive.exec.dynamic.partition=true;
      SET hive.exec.dynamic.partition.mode=nonstrict;
      set hive.exec.max.dynamic.partitions.pernode=10000;
      
      DROP TABLE IF EXISTS test;
      CREATE TABLE test (col1 string) PARTITIONED BY (p1 int) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\001' STORED AS TEXTFILE;
      INSERT OVERWRITE TABLE test PARTITION (p1) SELECT code, IF(salary > 600, 100, null) as p1 FROM jsmall;
      
      hive> SHOW PARTITIONS test;
      OK
      p1=100
      p1=__HIVE_DEFAULT_PARTITION__
      Time taken: 0.124 seconds, Fetched: 2 row(s)
      
      hive> ALTER TABLE test DROP partition (p1 = '__HIVE_DEFAULT_PARTITION__');
      FAILED: SemanticException Unexpected unknown partitions for (p1 = null)
      
      

      Attachments

        1. HIVE-11208.3.patch
          27 kB
          Aihua Xu
        2. HIVE-11208.2.patch
          16 kB
          Aihua Xu

        Issue Links

          Activity

            People

              aihuaxu Aihua Xu
              ychena Yongzhi Chen
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: