Repairing Hive or Impala partitions
Under certain conditions, you must manually repair metadata about Hive or Impala partitions. You learn when and how to do this.
- Hive: The dynamic partition refresh is disabled.
- Impala: Data files are removed by a non-Impala mechanism, and the table metadata is not updated
This task assumes you created a partitioned external table named students_part that stores partitions outside the warehouse. You remove one of the partition directories on the object store. This action renders the metastore inconsistent with S3. You repair the discrepancy manually to synchronize the metastore with S3 as follows;
- Hive
To repair partition metadata, you run the MSCK (metastore consistency check) Hive command to manually add partitions that are added to or removed from the object store, but are not present in the Hive metastore.
- Impala
To repair partition metadata, you run
ALTER TABLE
with theRECOVER PARTITIONS
clause to to find any new partition directories and the data files.