问题描述
select mid_id
from dws_uv_detail_day
where dt <= '2020-07-04'
group by mid_id
这是一张外部表,做查询时发现有过往元数据未清除,报了file hdfs:// 文件 does not exist.,找不到被删除的数据。
解决方式
drop table把元数据删了,然后又重新建了这张外部表,把数据同步到表就行了
load data inpath '/warehouse/gmall/dws/dws_uv_detail_day/文件' into table dws_uv_detail_day;
//通过hive命令关联数据到分区
alter table dws_uv_detail_day add partition (dt='2020-07-05') location '/warehouse/gmall/dws/dws_uv_detail_day/dt=2020-07-05';