How to add partition in hive managed table?

431 Views Asked by At

I am creating a partition through the spark in hdfs path not directly in hive. And then I am copying it to the user/hive/warehouse/test.db/testtbl through CP command. But after show partitions command in hive-shell it will not be showing the partition. I also ran the repair table command to repair the table and add the partition. But it will not work. How can i add that partitions in hive? Is there another way to add it?

1

There are 1 best solutions below

0
Mohana B C On

Anyone of the below command should work for you.

MSCK REPAIR TABLE <table_name>

ALTER TABLE <table_name> ADD PARTITION (<col_name>='<value>')