insert overwrite table nfyy_tn_20210228_1_union.mr_observations PARTITION(dt='2021-03-01')
(
select obs_updatehospital_dr,obs_consult_dr,obs_ispartogram from nfyy_dhcapp_20210228_1_full.mr_observations a
where 0=(select count(1) from nfyy_dhcapp_20210301_1_incr.mr_observations b where a.obs_rowid=b.obs_rowid)
union all
select obs_updatehospital_dr,obs_consult_dr,obs_ispartogram from nfyy_dhcapp_20210301_1_incr.mr_observations
)
思路:
在全量里面去除增量里关联到的数据 + 增量里的全部数据