优化2025年3月6日

This commit is contained in:
尹舟 2025-03-06 13:46:10 +08:00
parent 20af299076
commit abfc5c4d2c
2 changed files with 12 additions and 11 deletions

View File

@ -13,7 +13,7 @@ GROUP BY ds
,channel_id ,channel_id
,game_identity ,game_identity
,platform_id ,platform_id
UNION UNION all
SELECT channel_id game_channel_id SELECT channel_id game_channel_id
,game_identity ,game_identity
,platform_id game_platform_id ,platform_id game_platform_id

View File

@ -1,16 +1,17 @@
INSERT INTO dwd.active_df(relation_id,user_id,ds,ds_date) INSERT INTO dwd.active_df(relation_id,user_id,ds,ds_date)
SELECT t2.relation_id
,t1.user_id SELECT t1.relation_id
,t1.ds ,t2.user_id
,t2.ds
,'${biz-date}' ds_date ,'${biz-date}' ds_date
FROM pubdata_center.ods.active_account_list t1 FROM dim.game_product_relation t1
INNER JOIN dim.game_product_relation t2 INNER JOIN pubdata_center.ods.active_account_list t2
ON t1.channel_id = t2.game_channel_id ON t1.game_channel_id = t2.channel_id
AND t1.game_identity = t2.game_identity AND t1.game_identity = t2.game_identity
AND t1.platform_id = t2.game_platform_id AND t1.game_platform_id = t2.platform_id
where ds='${bizdate}' where ds='${bizdate}'
GROUP BY t2.relation_id GROUP BY t1.relation_id
,t1.user_id ,t2.user_id
,t1.ds ,t2.ds
ON CONFLICT (relation_id, user_id, ds) ON CONFLICT (relation_id, user_id, ds)
DO NOTHING; DO NOTHING;