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

EXCHANGE PARTITION should honor partition locations

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      Currently, if you add a partition with a custom location, EXCHANGE PARTITION will fail with a "File ... does not exist" error:

      drop table if exists text_partitioned;
      drop table if exists text_partitioned2;
      
      create table text_partitioned (b string) partitioned by (a int) stored as textfile;
      create table text_partitioned2 (b string) partitioned by (a int) stored as textfile;
      
      alter table text_partitioned add partition (a=1) location '/tmp/text/1';
      
      alter table text_partitioned2 exchange partition (a=1) with table text_partitioned;
      

      The last command fails with

      FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:Got exception: java.io.FileNotFoundException File file:/path/to/warehouse_dir/text_partitioned/a=1 does not exist)
      

      EXCHANGE PARTITION should honor the location that has been set for the partition.

      Attachments

        Activity

          People

            Unassigned Unassigned
            erwaman Anthony Hsu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: