insert overwrite into_dim_goods d partition(dt=2018-06-01)
select
row_number() over (order by id)+ta. max_id as gid
from tmp_s_inc as tb
cross JoIn
(select coalesce(max (gid),0)as max_id from dim_goods d where dt='2018-05-31') ta
union all
select * from dim_goods_d where dt= '2018-05-31'