Monday, 1 December 2014

How To Drop A Particular Partition in HIVE


Hive Partition can be dropped using  

ALTER TABLE Tablename DROP IF EXISTS
 PARTITION(PartitionedID=PartitionVALUE);

Lets see an example.
Say I have an emp Hive Table where there are 3 partitions for Department(A,B,C).
Inorder to delete a particular Department use the below query.
ALTER TABLE emp DROP IF EXISTS
  PARTITION(Department='A');

2 comments:

  1. Hi ,i just wanted the query for drop and delete and fortunately i got from your post thanks for posting useful blog ,do keep posting!! Hadoop Training in Velachery | Hadoop Training .
    Hadoop Training in Chennai | Hadoop .

    ReplyDelete
  2. It was really a nice article and i was really impressed by reading this Big data hadoop online training India

    ReplyDelete