From 2e28e88daec0f6743fd1b94ff01034aeb292f540 Mon Sep 17 00:00:00 2001 From: Fusionshh Date: Mon, 10 Nov 2025 14:11:49 +0300 Subject: [PATCH] recruit archive + CL_fz53 refatoring --- .../citizen_liability_fz53_flow_delta.hpl | 4 +- .../recruitment_five_flow_delta.hpl | 218 ++++++++++++++---- .../recruitment_five_flow_delta.hpl | 174 +++++++------- .../parallel/recruit_archive_flow.hpl | 87 +++---- .../parallel/recruit_archive_flow_delta.hpl | 92 +++----- .../parallel/recruit_archive_flow_repeat.hpl | 86 +++---- .../recruitment_five_flow_delta.hpl | 211 ++++++++++++++--- 7 files changed, 542 insertions(+), 330 deletions(-) diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_delta.hpl index 23dc1ac..8709f97 100644 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/parallel/citizen_liability_fz53_flow_delta.hpl @@ -404,9 +404,9 @@ and recruitment_id = '${IDM_ID}'; NOT i.hidden AS has_liability_fz53, ctid FROM public.infringement i - JOIN public.recruit r ON r.id = i.recruit_id -- Проверка на пустую строку + JOIN public.recruit r ON r.id = i.recruit_id AND (r.current_recruitment = '${IDM_ID}' or (r.current_recruitment is null and r.target_recruitment = '${IDM_ID}')) - AND i.updated_at >= '${M_INFR_UP_DATE}'::timestamp + AND i.updated_at > '${MAX_UPDATE_DATE}'::timestamp WHERE type = 'ADMINISTRATIVE') select fd.*, fd.ctid = (select max(ctid) from filtered_data) as last_row diff --git a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/recruitment_five_flow_delta.hpl index 18839e8..b5ea8f8 100644 --- a/mappings/info_recruits/citizen_tables/citizen_liability_fz53/recruitment_five_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/citizen_liability_fz53/recruitment_five_flow_delta.hpl @@ -21,34 +21,59 @@ - Table input + failed_deferment_liberation_permission_idm_ids_on_delta + Append streams + Y + + + max_update_date_from_deferment_liberation + failed_deferment_liberation_permission_idm_ids_on_delta + Y + + + max_update_date_from_deferment_liberation + updated_idm_ids_fromrecruits_deferment + Y + + + updated_idm_ids_fromrecruits_deferment + Append streams + Y + + + Append streams + Sort rows + Y + + + Sort rows citizen_liability_fz53_flow_delta.hpl Y - Table input + Sort rows citizen_liability_fz53_flow_delta.hpl 2 Y - Table input + Sort rows citizen_liability_fz53_flow_delta.hpl 3 Y - Table input + Sort rows citizen_liability_fz53_flow_delta.hpl 4 Y - Table input + Sort rows citizen_liability_fz53_flow_delta.hpl 5 Y - Table input - TableInput + Append streams + Append Y @@ -57,34 +82,9 @@ none - ervu-dashboard - N - 0 - WITH mud AS (SELECT recruitment_id, - MAX(execution_datetime) AS max_upd_date - FROM etl.job_execution - WHERE job_name = '${JOB_NAME}' - AND status IN ('SUCCESS', 'DELTA_SUCCESS') - GROUP BY recruitment_id) -SELECT r.idm_id -FROM ervu_dashboard.recruitment r - JOIN mud ON mud.recruitment_id = r.idm_id - JOIN ervu_dashboard.recruits_info ri - ON COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = r.idm_id - AND ri.updated_at > mud.max_upd_date - -union - -select r2.idm_id -from ervu_dashboard.recruitment r2 - join etl.job_execution je - on r2.idm_id = je.recruitment_id -where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') - and je.job_name = '${JOB_NAME}'; - Y - 352 + 864 288 @@ -112,6 +112,11 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') idm_id + + MAX_UPDATE_DATE + max_update_date + + Y @@ -135,10 +140,125 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') - 592 + 1312 128 + + failed_deferment_liberation_permission_idm_ids_on_delta + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + max_update_date_from_deferment_liberation + select r.idm_id as recruitment_id, + ? as max_update_date +from ervu_dashboard.recruitment r + join etl.job_execution je + on r.idm_id = je.recruitment_id +where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') + and je.job_name = '${JOB_NAME}'; + Y + + + 656 + 384 + + + + max_update_date_from_deferment_liberation + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + select max(updated_at) as max_update_date + from citizen_liability_fz53; + N + + + 464 + 288 + + + + updated_idm_ids_fromrecruits_deferment + TableInput + + Y + + 1 + + none + + + ervu_person_registry + N + 0 + max_update_date_from_deferment_liberation + WITH max_update_date(val) AS (SELECT CAST(? AS timestamp)) +SELECT DISTINCT COALESCE(r.current_recruitment, r.target_recruitment) AS recruitment_id, + ? as max_update_date +FROM recruit r + JOIN infringement i ON i.recruit_id = r.id + JOIN max_update_date mud ON TRUE +WHERE (mud.val IS NULL OR i.updated_at > mud.val); + N + + + 656 + 192 + + + + Sort rows + SortRows + + Y + + 1 + + none + + + ${java.io.tmpdir} + out + 100000 + + N + + Y + + + recruitment_id + Y + N + N + 0 + N + + + + + 1040 + 288 + + citizen_liability_fz53_flow_delta.hpl 2 PipelineExecutor @@ -163,6 +283,11 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') idm_id + + MAX_UPDATE_DATE + max_update_date + + Y @@ -186,8 +311,8 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') - 608 - 224 + 1312 + 208 @@ -214,6 +339,11 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') idm_id + + MAX_UPDATE_DATE + max_update_date + + Y @@ -237,7 +367,7 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') - 624 + 1312 288 @@ -265,6 +395,11 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') idm_id + + MAX_UPDATE_DATE + max_update_date + + Y @@ -288,7 +423,7 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') - 640 + 1312 368 @@ -316,6 +451,11 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') idm_id + + MAX_UPDATE_DATE + max_update_date + + Y @@ -339,7 +479,7 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') - 624 + 1312 448 diff --git a/mappings/info_recruits/citizen_tables/deferment_liberation_permission/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/deferment_liberation_permission/recruitment_five_flow_delta.hpl index 3404b4f..d1a53ae 100644 --- a/mappings/info_recruits/citizen_tables/deferment_liberation_permission/recruitment_five_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/deferment_liberation_permission/recruitment_five_flow_delta.hpl @@ -21,12 +21,12 @@ - Table input 2 + updated_idm_ids_fromrecruits_deferment Append streams Y - Table input 3 + failed_deferment_liberation_permission_idm_ids_on_delta Append streams Y @@ -36,8 +36,8 @@ Y - Table input - Table input 2 + max_update_date_from_deferment_liberation + updated_idm_ids_fromrecruits_deferment Y @@ -46,8 +46,8 @@ Y - Table input - Table input 3 + max_update_date_from_deferment_liberation + failed_deferment_liberation_permission_idm_ids_on_delta Y @@ -122,87 +122,6 @@ 288 - - Table input - TableInput - - N - - 1 - - none - - - ervu-dashboard - N - 0 - select max(updated_at) as max_update_date - from deferment_liberation; - N - - - 192 - 288 - - - - Table input 2 - TableInput - - Y - - 1 - - none - - - ervu_person_registry - N - 0 - Table input - WITH max_update_date(val) AS (SELECT CAST(? AS timestamp)) -SELECT DISTINCT COALESCE(r.current_recruitment_id, r.target_recruitment_id) AS recruitment_id, - ? as max_update_date -FROM recruits r -JOIN recruits_deferment rd ON rd.recruit_id = r.id -JOIN max_update_date mud ON TRUE -WHERE (mud.val IS NULL OR rd.system_update_date > mud.val); - N - - - 384 - 192 - - - - Table input 3 - TableInput - - Y - - 1 - - none - - - ervu-dashboard - N - 0 - Table input - select r.idm_id as recruitment_id, - ? as max_update_date -from ervu_dashboard.recruitment r - join etl.job_execution je - on r.idm_id = je.recruitment_id -where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') - and je.job_name = '${JOB_NAME}'; - Y - - - 384 - 384 - - deferment_liberation_permission_flow_delta.hpl PipelineExecutor @@ -483,6 +402,87 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') 448 + + failed_deferment_liberation_permission_idm_ids_on_delta + TableInput + + Y + + 1 + + none + + + ervu-dashboard + N + 0 + max_update_date_from_deferment_liberation + select r.idm_id as recruitment_id, + ? as max_update_date +from ervu_dashboard.recruitment r + join etl.job_execution je + on r.idm_id = je.recruitment_id +where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') + and je.job_name = '${JOB_NAME}'; + Y + + + 384 + 384 + + + + max_update_date_from_deferment_liberation + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + select max(updated_at) as max_update_date + from deferment_liberation; + N + + + 192 + 288 + + + + updated_idm_ids_fromrecruits_deferment + TableInput + + Y + + 1 + + none + + + ervu_person_registry + N + 0 + max_update_date_from_deferment_liberation + WITH max_update_date(val) AS (SELECT CAST(? AS timestamp)) +SELECT DISTINCT COALESCE(r.current_recruitment_id, r.target_recruitment_id) AS recruitment_id, + ? as max_update_date +FROM recruits r +JOIN recruits_deferment rd ON rd.recruit_id = r.id +JOIN max_update_date mud ON TRUE +WHERE (mud.val IS NULL OR rd.system_update_date > mud.val); + N + + + 384 + 192 + + diff --git a/mappings/info_recruits/citizen_tables/recruit_archive/parallel/recruit_archive_flow.hpl b/mappings/info_recruits/citizen_tables/recruit_archive/parallel/recruit_archive_flow.hpl index ef1dfb1..372af3c 100644 --- a/mappings/info_recruits/citizen_tables/recruit_archive/parallel/recruit_archive_flow.hpl +++ b/mappings/info_recruits/citizen_tables/recruit_archive/parallel/recruit_archive_flow.hpl @@ -50,26 +50,6 @@ Change job status on error Y - - Table input - Identify last row in a stream - Y - - - Identify last row in a stream - Table output - Y - - - Identify last row in a stream - Detect empty stream - Y - - - Identify last row in a stream - sort_by_recruit_id - Y - sort_by_recruit_id Update @@ -80,6 +60,21 @@ Filter rows Y + + Table input + Detect empty stream + Y + + + Table input + Table output + Y + + + Table input + sort_by_recruit_id + Y + Abort @@ -97,7 +92,7 @@ 0 - 1344 + 1168 480 @@ -133,7 +128,7 @@ and recruitment_id = '${IDM_ID}'; - 1136 + 960 480 @@ -165,7 +160,7 @@ and recruitment_id = '${IDM_ID}'; - 1360 + 960 176 @@ -211,7 +206,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - 720 + 496 176 @@ -247,13 +242,13 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); Change job status on success - 1360 + 960 320 - Identify last row in a stream - DetectLastRow + Table input + TableInput N @@ -262,27 +257,10 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); none - last_row - - - 720 - 320 - - - - Table input - TableInput - - Y - - 1 - - none - - ervu_person_archive N - SELECT + + with filtered_data as (SELECT id, recruit_id, archivation_reason_id, @@ -290,13 +268,12 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); updated_at, hidden, recruit_extract_enable, - CASE - WHEN recruit_extract_enable IS true THEN true - ELSE false - END AS card_in_archive + ctid FROM public.recruit_archive -WHERE '${IDM_ID}' != '' -- Проверка на пустую строку - AND vk_id = '${IDM_ID}' +WHERE vk_id = '${IDM_ID}') +select fd.*, + fd.ctid = (select max(ctid) from filtered_data) as last_row + from filtered_data fd; Y @@ -363,7 +340,7 @@ WHERE '${IDM_ID}' != '' -- Проверка на пустую строку Y - 912 + 736 320 @@ -398,7 +375,7 @@ WHERE '${IDM_ID}' != '' -- Проверка на пустую строку Y - 912 + 736 480 @@ -432,7 +409,7 @@ WHERE '${IDM_ID}' != '' -- Проверка на пустую строку - 720 + 496 480 diff --git a/mappings/info_recruits/citizen_tables/recruit_archive/parallel/recruit_archive_flow_delta.hpl b/mappings/info_recruits/citizen_tables/recruit_archive/parallel/recruit_archive_flow_delta.hpl index 541c4f3..fc6f76e 100644 --- a/mappings/info_recruits/citizen_tables/recruit_archive/parallel/recruit_archive_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/recruit_archive/parallel/recruit_archive_flow_delta.hpl @@ -45,26 +45,6 @@ Change job status on error Y - - Table input - Identify last row in a stream - Y - - - Identify last row in a stream - Insert / update - Y - - - Identify last row in a stream - Detect empty stream - Y - - - Identify last row in a stream - sort_by_recruit_id - Y - sort_by_recruit_id Update @@ -80,6 +60,21 @@ Filter rows Y + + Table input + Detect empty stream + Y + + + Table input + sort_by_recruit_id + Y + + + Table input + Insert / update + Y + Abort @@ -97,7 +92,7 @@ 0 - 1392 + 1136 496 @@ -133,7 +128,7 @@ and recruitment_id = '${IDM_ID}'; - 1152 + 896 496 @@ -165,7 +160,7 @@ and recruitment_id = '${IDM_ID}'; - 1376 + 896 224 @@ -214,7 +209,7 @@ and recruitment_id = '${IDM_ID}'; - 704 + 544 224 @@ -250,25 +245,7 @@ and recruitment_id = '${IDM_ID}'; Change job status on success - 1376 - 352 - - - - Identify last row in a stream - DetectLastRow - - N - - 1 - - none - - - last_row - - - 704 + 896 352 @@ -332,7 +309,7 @@ and recruitment_id = '${IDM_ID}'; N - 944 + 736 352 @@ -340,7 +317,7 @@ and recruitment_id = '${IDM_ID}'; Table input TableInput - Y + N 1 @@ -349,7 +326,8 @@ and recruitment_id = '${IDM_ID}'; ervu_person_archive N - SELECT + + with filtered_data as (SELECT id, recruit_id, archivation_reason_id, @@ -357,14 +335,16 @@ and recruitment_id = '${IDM_ID}'; updated_at, hidden, recruit_extract_enable, - CASE - WHEN recruit_extract_enable IS true THEN true - ELSE false - END AS card_in_archive -FROM public.recruit_archive -WHERE '${IDM_ID}' != '' -- Проверка на пустую строку - AND vk_id = '${IDM_ID}' - AND updated_at >= '${M_RECARCH_UP_DATE}'::timestamp + ctid +FROM public.recruit_archive ra +WHERE vk_id = '${IDM_ID}' + and case when '${MAX_UPDATE_DATE}' <> '' + then ra.updated_at > to_date('${MAX_UPDATE_DATE}', 'YYYY-MM-DD') + else true end) +select fd.*, + fd.ctid = (select max(ctid) from filtered_data) as last_row + from filtered_data fd; + Y @@ -408,7 +388,7 @@ WHERE '${IDM_ID}' != '' -- Проверка на пустую строку Y - 944 + 736 496 @@ -442,7 +422,7 @@ WHERE '${IDM_ID}' != '' -- Проверка на пустую строку - 704 + 544 496 diff --git a/mappings/info_recruits/citizen_tables/recruit_archive/parallel/recruit_archive_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/recruit_archive/parallel/recruit_archive_flow_repeat.hpl index 5d7bade..81bcb9a 100644 --- a/mappings/info_recruits/citizen_tables/recruit_archive/parallel/recruit_archive_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/recruit_archive/parallel/recruit_archive_flow_repeat.hpl @@ -50,26 +50,6 @@ Change job status on error Y - - Table input - Identify last row in a stream - Y - - - Identify last row in a stream - Insert / update - Y - - - Identify last row in a stream - Detect empty stream - Y - - - Identify last row in a stream - sort_by_recruit_id - Y - sort_by_recruit_id Update @@ -80,6 +60,21 @@ Filter rows Y + + Table input + Detect empty stream + Y + + + Table input + sort_by_recruit_id + Y + + + Table input + Insert / update + Y + Abort @@ -97,7 +92,7 @@ 0 - 1120 + 912 352 @@ -133,7 +128,7 @@ and recruitment_id = '${IDM_ID}'; - 928 + 720 352 @@ -165,7 +160,7 @@ and recruitment_id = '${IDM_ID}'; - 1152 + 720 80 @@ -229,7 +224,7 @@ DO UPDATE SET - 528 + 320 80 @@ -265,25 +260,7 @@ DO UPDATE SET Change job status on success - 1152 - 208 - - - - Identify last row in a stream - DetectLastRow - - N - - 1 - - none - - - last_row - - - 528 + 720 208 @@ -305,7 +282,6 @@ DO UPDATE SET = id id - ervu_dashboard recruit_archive
@@ -348,7 +324,7 @@ DO UPDATE SET Y - 720 + 528 208 @@ -356,7 +332,7 @@ DO UPDATE SET Table input TableInput - Y + N 1 @@ -365,7 +341,8 @@ DO UPDATE SET ervu_person_archive N - SELECT + + with filtered_data as (SELECT id, recruit_id, archivation_reason_id, @@ -373,13 +350,12 @@ DO UPDATE SET updated_at, hidden, recruit_extract_enable, - CASE - WHEN recruit_extract_enable IS true THEN true - ELSE false - END AS card_in_archive + ctid FROM public.recruit_archive -WHERE '${IDM_ID}' != '' -- Проверка на пустую строку - AND vk_id = '${IDM_ID}' +WHERE vk_id = '${IDM_ID}') +select fd.*, + fd.ctid = (select max(ctid) from filtered_data) as last_row + from filtered_data fd; Y @@ -424,7 +400,7 @@ WHERE '${IDM_ID}' != '' -- Проверка на пустую строку Y - 720 + 528 352 @@ -458,7 +434,7 @@ WHERE '${IDM_ID}' != '' -- Проверка на пустую строку - 528 + 320 352 diff --git a/mappings/info_recruits/citizen_tables/recruit_archive/recruitment_five_flow_delta.hpl b/mappings/info_recruits/citizen_tables/recruit_archive/recruitment_five_flow_delta.hpl index 3143b4f..b349e90 100644 --- a/mappings/info_recruits/citizen_tables/recruit_archive/recruitment_five_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/recruit_archive/recruitment_five_flow_delta.hpl @@ -21,33 +21,109 @@ - Table input + Append streams + Sort rows + Y + + + max_update_date_from_recruit_archive + updated_idm_ids_from_source_recruit_archive + Y + + + max_update_date_from_recruit_archive + failed_recruit_archive_idm_ids_on_delta + Y + + + updated_idm_ids_from_source_recruit_archive + Append streams + Y + + + failed_recruit_archive_idm_ids_on_delta + Append streams + Y + + + Sort rows recruit_archive_flow_delta.hpl Y - Table input + Sort rows recruit_archive_flow_delta.hpl 2 Y - Table input + Sort rows recruit_archive_flow_delta.hpl 3 Y - Table input + Sort rows recruit_archive_flow_delta.hpl 4 Y - Table input + Sort rows recruit_archive_flow_delta.hpl 5 Y - Table input + Append streams + Append + + Y + + 1 + + none + + + + + 336 + 304 + + + + Sort rows + SortRows + + Y + + 1 + + none + + + ${java.io.tmpdir} + out + 100000 + + N + + Y + + + recruitment_id + Y + N + N + 0 + N + + + + + 496 + 304 + + + + failed_recruit_archive_idm_ids_on_delta TableInput Y @@ -60,32 +136,42 @@ ervu-dashboard N 0 - WITH mud AS (SELECT recruitment_id, - MAX(execution_datetime) AS max_upd_date - FROM etl.job_execution - WHERE job_name = '${JOB_NAME}' - AND status IN ('SUCCESS', 'DELTA_SUCCESS') - GROUP BY recruitment_id) -SELECT r.idm_id -FROM ervu_dashboard.recruitment r - JOIN mud ON mud.recruitment_id = r.idm_id - JOIN ervu_dashboard.recruits_info ri - ON COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = r.idm_id - AND ri.updated_at > mud.max_upd_date - -union - -select r2.idm_id -from ervu_dashboard.recruitment r2 + max_update_date_from_recruit_archive + select r.idm_id as recruitment_id, + ? as max_update_date +from ervu_dashboard.recruitment r join etl.job_execution je - on r2.idm_id = je.recruitment_id + on r.idm_id = je.recruitment_id where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') and je.job_name = '${JOB_NAME}'; Y - 352 - 288 + 176 + 400 + + + + max_update_date_from_recruit_archive + TableInput + + N + + 1 + + none + + + ervu-dashboard + N + 0 + select max(updated_at) as max_update_date + from recruit_archive; + N + + + 0 + 304 @@ -112,6 +198,11 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') idm_id + + MAX_UPDATE_DATE + max_update_date + + Y @@ -135,8 +226,8 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') - 640 - 128 + 752 + 144 @@ -163,6 +254,11 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') idm_id + + MAX_UPDATE_DATE + max_update_date + + Y @@ -186,8 +282,8 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') - 640 - 208 + 752 + 224 @@ -214,6 +310,11 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') idm_id + + MAX_UPDATE_DATE + max_update_date + + Y @@ -237,8 +338,8 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') - 640 - 288 + 752 + 304 @@ -265,6 +366,11 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') idm_id + + MAX_UPDATE_DATE + max_update_date + + Y @@ -288,8 +394,8 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') - 640 - 368 + 752 + 384 @@ -316,6 +422,11 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') idm_id + + MAX_UPDATE_DATE + max_update_date + + Y @@ -339,8 +450,36 @@ where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING') - 656 - 448 + 752 + 464 + + + + updated_idm_ids_from_source_recruit_archive + TableInput + + Y + + 1 + + none + + + ervu_person_archive + N + 0 + max_update_date_from_recruit_archive + WITH max_update_date(val) AS (SELECT CAST(? AS timestamp)) +SELECT DISTINCT ra.vk_id as recruitment_id, + ? as max_update_date +FROM public.recruit_archive ra +JOIN max_update_date mud ON TRUE +WHERE (mud.val IS NULL OR ra.updated_at > mud.val); + N + + + 176 + 208