marjun
marjun

Reputation: 726

how to drop partition metadata from hive, when partition is drop by using alter drop command

I have dropped the all the partitions in the hive table by using the alter command

alter table emp drop partition (hiredate>'0');

After droping partitions still I can see the partitions metadata.How to delete this partition metadata? Can I use the same table for new partitions?

enter image description here

Upvotes: 2

Views: 2101

Answers (1)

brandon.bell
brandon.bell

Reputation: 1411

Partitioning is defined when the table is created. By running ALTER TABLE ... DROP PARTITION ... you are only deleting the data and metadata for the matching partitions, not the partitioning of the table itself.

Your best bet at this point will be to recreate the table without the partitioning. If there is some data you are trying to save, rename the current table, create the new table (without the partitioning), then run an INSERT from the old table to the new table.

Upvotes: 3

Related Questions