Add EXTERNAL SQL scripts

This commit is contained in:
2026-04-20 14:55:25 +08:00
parent c05ba7ec7e
commit b4979eed82
344 changed files with 61619 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
-- Databricks notebook source
-- 源表DWD.DWD_TD_IMS_CITY_MAPPING
-- 目标表DM.DM_TD_IMS_CITY_MAPPING,DWS.DWS_TD_GEOGRAPHY
-- COMMAND ----------
--dwd to dws
--ims city和标准城市名以及拆分比mapping表
insert overwrite table dws.dws_td_ims_city_mapping
select distinct
audit_cod ,
city_c ,
city_c_d ,
ratio ,
from_utc_timestamp(current_timestamp(),'UTC+8'),
from_utc_timestamp(current_timestamp(),'UTC+8')
from dwd.dwd_td_ims_city_mapping
;
--dws to dm
insert overwrite table dm.dm_td_ims_city_mapping
select distinct
audit_cod ,
city_c ,
city_c_d ,
city_code,
ratio ,
from_utc_timestamp(current_timestamp(),'UTC+8'),
from_utc_timestamp(current_timestamp(),'UTC+8')
from dws.dws_td_ims_city_mapping t1
left join dws.dws_td_geography t2 on concat(t1.city_c_d,'')=t2.city_name