Hive: Add partitions for existing folder structure

Use msck repair table command:

MSCK [REPAIR] TABLE tablename;

or

ALTER TABLE tablename RECOVER PARTITIONS;

if you are running Hive on EMR.

Read more details about both commands here: RECOVER PARTITIONS

Leave a Comment