Support Questions

Find answers, ask questions, and share your expertise

Unable to delete partition having %01 in the name

avatar
Explorer

Dear Members,

 

I have accidently created a partition having characters %01 in the name. %01 is start of header `as per the notepad++`.

When i am trying to delete the partition using ALTER statement, there is no error but partition also not getting deleted.

 

can anyone suggest how to delete such partitions with special characters.

 

ALTER TABLE <table_name> DROP IF EXISTS PARTITION (code='YATHAH%0188QW');

 

1 ACCEPTED SOLUTION

avatar
Explorer

Found the solution - replace %01 --> \001 and it did the trick to delete the partition.

View solution in original post

8 REPLIES 8

avatar
Guru

@hive1 

 

Can you set below param:

 

 set hive.msck.path.validation=skip;

Then use

 

MSCK REPAIR TABLE tablename DROP PARTITIONS;

 

avatar
Explorer

Hello Asish,

 

Thanks for response. I tried as per your comments still the result is same.

Partition is not getting dropped.

 

avatar
Guru

hi @hive1  WHat is the error you recieved?

Can you also try with set hive.msck.path.validation=ignore

 

avatar
Explorer

There is no error, i think the partition is not getting recognized because of -> %01  

avatar
Guru

avatar
Explorer

Hello Asish, This also didn't work.

avatar
Master Mentor

@hive1 
What is the hive version? Can you try the below and revert
Set  the below two properties before executing the rename partition

Spoiler
hive> set fs.hdfs.impl.disable.cache=false;
hive> set fs.file.impl.disable.cache=false;

Then run the rename partition command

Spoiler
hive> ALTER TABLE <table_name> (code='YATHAH%0188QW') RENAME TO PARTITION (code='new_name');

Share the output for further analysis

 

 

 

avatar
Explorer

Found the solution - replace %01 --> \001 and it did the trick to delete the partition.