How to update partition metadata in Hive , when partition data is manualy deleted from HDFS

后端 未结 3 2190
南旧
南旧 2020-12-03 17:05

What is the way to automatically update the metadata of Hive partitioned tables?

If new partition data\'s were added to HDFS (without alter table add partition comma

3条回答
  •  被撕碎了的回忆
    2020-12-03 17:46

    Ensure the table is set to external, drop all partitions then run the table repair:

    alter table mytable_name set TBLPROPERTIES('EXTERNAL'='TRUE')
    alter table mytable_name drop if exists partition (`mypart_name` <> 'null');
    msck repair table mytable_name;
    


    If msck repair throws an error, then run hive from the terminal as:
    hive --hiveconf hive.msck.path.validation=ignore
    or set hive.msck.path.validation=ignore;

提交回复
热议问题