Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

Unable to delete partition having %01 in the name

New Contributor

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

New Contributor

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

View solution in original post

8 REPLIES 8

Super Collaborator

@hive1 

 

Can you set below param:

 

 set hive.msck.path.validation=skip;

Then use

 

MSCK REPAIR TABLE tablename DROP PARTITIONS;

 

New Contributor

Hello Asish,

 

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

Partition is not getting dropped.

 

Super Collaborator

hi @hive1  WHat is the error you recieved?

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

 

New Contributor

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

Super Collaborator

New Contributor

Hello Asish, This also didn't work.

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

 

 

 

New Contributor

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

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.