问题描述:
hive表 insert 数据时,报错vertex failed ,vertex name =Map 1...
mapred.invalidinputException:input path does not exists hdfs://表路径/表名/表分区
详细可参考hive sql 遇到 input path does not exists 问题-优快云博客
问题定位:
我是将a表的多个分区insert到b表,发现多个分区表显示hdfs路径不存在,去select * from 路径不存在的分区表,再次报错:
query failed :partition location does not exist
查询不到当前分区 ,说明hive分区表元数据和hdfs文件目录不一致(也可能是分区删除),导致的读异常
解决方案:
1、修复分区
msck repair table dwd.dwd_abc_111;
再次运行select * 依然不行
2、删除分区
alter table 表名 drop partition (分区字段='要删除的具体分区',分区字段=。。)
--例如
alter table dws.dws_tmp_2022 drop partition (etl_dt='20230110');
这个方式可以解决问题,之后再重新insert分区就可以了。