Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
650 B
11
Indexable
Never
INSERT INTO MY__DWH.h_groups(hk_group_id, group_id,registration_dt,load_dt,load_src)
select
       hash(id) as  hk_group_id,
       id as group_id,
       registration_dt,
       now() as load_dt,
       's3' as load_src
       from MY__STAGING.groups
where hash(id) not in (select hk_group_id from MY__DWH.h_groups);


INSERT INTO MY__DWH.h_dialogs(hk_message_id, message_id,message_ts,load_dt,load_src)
select
       hash(message_id) as  hk_message_id,
       message_id,
       message_ts,
       now() as load_dt,
       's3' as load_src
       from MY__STAGING.dialogs
where hash(message_id) not in (select hk_message_id from MY__DWH.h_dialogs);
Leave a Comment