add workflow 天润Smart-ccc会话数据,dev

This commit is contained in:
root 2024-08-14 16:20:11 +08:00
parent 7334c62665
commit 99c356ec57
1 changed files with 4 additions and 3 deletions

View File

@ -4,14 +4,14 @@
/*Brilliance stems from wisdoms. */
/*************Head Section**************************************************************************/
/*Script Use: Periodically load data to :cust_chat_record_info(ccc客户会话记录信息) */
/*Create Date:2024-08-14 16:14:15 */
/*Create Date:2024-08-14 16:19:43 */
/*SDM Developed By: dev */
/*SDM Developed Date: 2024-08-14 */
/*SDM Checked By: dev */
/*SDM Checked Date: 2024-08-14 */
/*Script Developed By: dev */
/*Script Checked By: dev */
/*Source table 1: :COMMDB.select replace(jsonb_array_elements(visitor_ids::jsonb)::text,'"','') as visitor_id ,* from p30_common.d_ccc_cust_info dcci
/*Source table 1: :COMMDB.select replace(jsonb_array_elements(visitor_ids::jsonb)::text,'"','') as visitor_id ,row_number() over(partition by replace(jsonb_array_elements(visitor_ids::jsonb)::text,'"','') order by id desc) rn ,* from p30_common.d_ccc_cust_info dcci
where visitor_ids <>''*/
/*Source table 2: :COMMDB.cust_chat_ccc_record */
/*Job Type: Inbound transform (Tier 1 to Tier 2) */
@ -94,9 +94,10 @@ SELECT
,'cust_chat_ccc_record' /*Src_Table*/
FROM :COMMDB.cust_chat_ccc_record p0
LEFT JOIN (select replace(jsonb_array_elements(visitor_ids::jsonb)::text,'"','') as visitor_id ,* from p30_common.d_ccc_cust_info dcci
LEFT JOIN (select replace(jsonb_array_elements(visitor_ids::jsonb)::text,'"','') as visitor_id ,row_number() over(partition by replace(jsonb_array_elements(visitor_ids::jsonb)::text,'"','') order by id desc) rn ,* from p30_common.d_ccc_cust_info dcci
where visitor_ids <>'') p1
ON p0 .visitor_id =p1 .visitor_id
and p1.rn=1
;