[ 
https://issues.apache.org/jira/browse/HIVE-16287?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ying Chen updated HIVE-16287:
-----------------------------
    Description: 
I was renaming my partition in a table that I've created using the location 
clause, and noticed that when after rename is completed, my partition is moved 
to the hive warehouse (hive.metastore.warehouse.dir).

{quote}
create table test_local_part (col1 int) partitioned by (col2 int) location 
'/tmp/testtable/test_local_part';
insert into test_local_part  partition (col2=1) values (1),(3);
insert into test_local_part  partition (col2=2) values (3);
alter table test_local_part partition (col2='1') rename to partition (col2='4');
{quote}

Running: 
   describe formatted test_local_part partition (col2='2')

# Detailed Partition Information                 
Partition Value:        [2]                      
Database:               default                  
Table:                  test_local_part          
CreateTime:             Mon Mar 20 13:25:28 PDT 2017     
LastAccessTime:         UNKNOWN                  
Protect Mode:           None                     
Location:               
*hdfs://my.server.com:8020/tmp/testtable/test_local_part/col2=2*

Running: 
   describe formatted test_local_part partition (col2='4')

# Detailed Partition Information                 
Partition Value:        [4]                      
Database:               default                  
Table:                  test_local_part          
CreateTime:             Mon Mar 20 13:24:53 PDT 2017     
LastAccessTime:         UNKNOWN                  
Protect Mode:           None                     
Location:               
*hdfs://my.server.com:8020/apps/hive/warehouse/test_local_part/col2=4*

---
Per Sergio's comment - "The rename should create the new partition name in the 
same location of the table. "


  was:
I was renaming my partition in a table that I've created using the location 
clause, and noticed that when after rename is completed, my partition is moved 
to the hive warehouse (hive.metastore.warehouse.dir).

{quote}
create table test_local_part (col1 int) partitioned by (col2 int) location 
'/tmp/testtable/test_local_part';
insert into test_local_part  partition (col2=1) values (1),(3);
insert into test_local_part  partition (col2=2) values (3);
alter table test_local_part partition (col2='1') rename to partition (col2='4');
{quote}

Running: 
  {{describe formatted test_local_part partition (col2='2')}} 

# Detailed Partition Information                 
Partition Value:        [2]                      
Database:               default                  
Table:                  test_local_part          
CreateTime:             Mon Mar 20 13:25:28 PDT 2017     
LastAccessTime:         UNKNOWN                  
Protect Mode:           None                     
Location:               
*hdfs://my.server.com:8020/tmp/testtable/test_local_part/col2=2*

Running: 
   {{describe formatted test_local_part partition (col2='4')}} 

# Detailed Partition Information                 
Partition Value:        [4]                      
Database:               default                  
Table:                  test_local_part          
CreateTime:             Mon Mar 20 13:24:53 PDT 2017     
LastAccessTime:         UNKNOWN                  
Protect Mode:           None                     
Location:               
*hdfs://my.server.com:8020/apps/hive/warehouse/test_local_part/col2=4*




> Alter table partition rename with location - moves partition back to hive 
> warehouse
> -----------------------------------------------------------------------------------
>
>                 Key: HIVE-16287
>                 URL: https://issues.apache.org/jira/browse/HIVE-16287
>             Project: Hive
>          Issue Type: Bug
>          Components: Metastore
>    Affects Versions: 2.1.0
>         Environment: RHEL 6.8 
>            Reporter: Ying Chen
>            Priority: Minor
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> I was renaming my partition in a table that I've created using the location 
> clause, and noticed that when after rename is completed, my partition is 
> moved to the hive warehouse (hive.metastore.warehouse.dir).
> {quote}
> create table test_local_part (col1 int) partitioned by (col2 int) location 
> '/tmp/testtable/test_local_part';
> insert into test_local_part  partition (col2=1) values (1),(3);
> insert into test_local_part  partition (col2=2) values (3);
> alter table test_local_part partition (col2='1') rename to partition 
> (col2='4');
> {quote}
> Running: 
>    describe formatted test_local_part partition (col2='2')
> # Detailed Partition Information               
> Partition Value:      [2]                      
> Database:             default                  
> Table:                test_local_part          
> CreateTime:           Mon Mar 20 13:25:28 PDT 2017     
> LastAccessTime:       UNKNOWN                  
> Protect Mode:         None                     
> Location:             
> *hdfs://my.server.com:8020/tmp/testtable/test_local_part/col2=2*
> Running: 
>    describe formatted test_local_part partition (col2='4')
> # Detailed Partition Information               
> Partition Value:      [4]                      
> Database:             default                  
> Table:                test_local_part          
> CreateTime:           Mon Mar 20 13:24:53 PDT 2017     
> LastAccessTime:       UNKNOWN                  
> Protect Mode:         None                     
> Location:             
> *hdfs://my.server.com:8020/apps/hive/warehouse/test_local_part/col2=4*
> ---
> Per Sergio's comment - "The rename should create the new partition name in 
> the same location of the table. "



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to