场景:发现某天数据错误,当天并未发现,在排查报表问题时,发现ODS拉链表有数据问题
要求:当前数据日期为2021-04-30,数据错误发生在2021-03-31,需要恢复到2021-03-30
解决方法:
步骤1:拉链表恢复到2021-03-30
insert overwrite table ods.crm_cst_info
select
cst_id,cst_nm,...,
start_dt,
if(end_dt>2021-03-30,'9999-12-31',end_dt)
from ods.crm_cst_info
where start_dt<='2021-03-30'
步骤2:分析dwd.crm_cst_info所有下游任务,从2021-03-31开始重跑所有下游任务