From 6889a80db2c241985539cdf868cbb2afbfbda802 Mon Sep 17 00:00:00 2001 From: Fusionshh Date: Thu, 23 Oct 2025 08:12:24 +0300 Subject: [PATCH] some useless changes to deploy --- .../parallel/individual_entrepreneur_flow.hpl | 2 +- .../individual_entrepreneur_flow_delta.hpl | 2 +- .../individual_entrepreneur_flow_repeat.hpl | 2 +- .../parallel/self_employed_flow.hpl | 2 +- .../parallel/self_employed_flow_delta.hpl | 2 +- .../parallel/self_employed_flow_repeat.hpl | 2 +- .../parallel/work_activity_flow.hpl | 23 ++++++++++--------- .../parallel/work_activity_flow_delta.hpl | 7 +++--- .../parallel/work_activity_flow_repeat.hpl | 7 +++--- 9 files changed, 26 insertions(+), 23 deletions(-) diff --git a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow.hpl b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow.hpl index 0bd8fd8..a5c217c 100644 --- a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow.hpl +++ b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow.hpl @@ -415,7 +415,7 @@ select fd.recruit_id, reg_npd_date, dereg_npd_date, fd.actual as actual, - fd.ctid = (select max(ctid) from fd) as last_row + fd.ctid = (select max(ctid) from filtered_data) as last_row from filtered_data fd; Y diff --git a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_delta.hpl b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_delta.hpl index 7b446a1..17db1ff 100644 --- a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_delta.hpl @@ -621,7 +621,7 @@ select fd.recruit_id, to_date(pred_ip_elem ->> 'dataRegIP', 'YYYY-MM-DD') as pred_registration_date, to_date(pred_ip_elem ->> 'dataINNNed', 'YYYY-MM-DD') as pred_deregistration_date, to_date(fd.pred_ip_elem ->> 'dataSved', 'YYYY-MM-DD') > '${MAX_SOURCE_UPDATE_DATE}' as pred_need_update, - fd.ctid = (select max(ctid) from fd) as last_row + fd.ctid = (select max(ctid) from filtered_data) as last_row from filtered_data fd; Y diff --git a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_repeat.hpl index 0695897..bfa81e5 100644 --- a/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/work/individual_entrepreneur/parallel/individual_entrepreneur_flow_repeat.hpl @@ -419,7 +419,7 @@ select fd.recruit_id, reg_npd_date, dereg_npd_date, fd.actual as actual, - fd.ctid = (select max(ctid) from fd) as last_row + fd.ctid = (select max(ctid) from filtered_data) as last_row from filtered_data fd; Y diff --git a/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow.hpl b/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow.hpl index b1c696d..d0a8c62 100644 --- a/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow.hpl +++ b/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow.hpl @@ -355,7 +355,7 @@ select fd.recruit_id, to_date(npd_elem ->> 'dataUchNPD', 'YYYY-MM-DD') as register_date, to_date(npd_elem ->> 'dataSnUchNPD', 'YYYY-MM-DD') as deregistration_date, actual, - fd.ctid = (select max(ctid) from fd) as last_row + fd.ctid = (select max(ctid) from filtered_data) as last_row from filtered_data fd; Y diff --git a/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_delta.hpl b/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_delta.hpl index 05c6721..6510e7c 100644 --- a/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_delta.hpl @@ -514,7 +514,7 @@ select fd.recruit_id, to_date(pred_npd_elem ->> 'dataUchNPD', 'YYYY-MM-DD') as pred_register_date, to_date(pred_npd_elem ->> 'dataSnUchNPD', 'YYYY-MM-DD') as pred_deregistration_date, to_date(pred_npd_elem ->> 'dataSved', 'YYYY-MM-DD') > '${MAX_SOURCE_UPDATE_DATE}' as pred_need_update, - fd.ctid = (select max(ctid) from fd) as last_row + fd.ctid = (select max(ctid) from filtered_data) as last_row from filtered_data fd; Y diff --git a/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_repeat.hpl index d7eb6f2..2f03a68 100644 --- a/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/work/self_employed/parallel/self_employed_flow_repeat.hpl @@ -356,7 +356,7 @@ select fd.recruit_id, to_date(npd_elem ->> 'dataUchNPD', 'YYYY-MM-DD') as register_date, to_date(npd_elem ->> 'dataSnUchNPD', 'YYYY-MM-DD') as deregistration_date, actual, - fd.ctid = (select max(ctid) from fd) as last_row + fd.ctid = (select max(ctid) from filtered_data) as last_row from filtered_data fd; Y diff --git a/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow.hpl b/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow.hpl index e88e32b..915d5b5 100644 --- a/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow.hpl +++ b/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow.hpl @@ -365,9 +365,10 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); ervu-dashboard N - WITH filteredData AS (SELECT ri.recruit_id, + + WITH filtered_data AS (SELECT ri.recruit_id, ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' as trud_arr, - ctid + ctid FROM ervu_dashboard.recruits_info ri WHERE jsonb_typeof(ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat') = 'array' AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}')) @@ -379,19 +380,19 @@ SELECT fd.recruit_id, to_date(trud_elem ->> 'dataMeropr', 'YYYY-MM-DD') AS personnel_event_date, trud_elem ->> 'naimTipKadrMeropr' AS personnel_event_type, to_date(trud_elem ->> 'dataSved', 'YYYY-MM-DD') AS source_update_date, - coalesce((trud_elem ->> 'prAktMestRab') = '1', false) AS actual_employer, + coalesce((trud_elem ->> 'prAktMestRab') = '1', false) AS actual_employer, to_date(uhod_elem ->> 'dataNachUhodReb', 'YYYY-MM-DD') AS parental_leave_start_date, to_date(uhod_elem ->> 'dataKonUhodReb', 'YYYY-MM-DD') AS parental_leave_end_date, - fd.ctid = (select max(ctid) from fd) as last_row -FROM filteredData fd + fd.ctid = (select max(ctid) from filtered_data) as last_row +FROM filtered_data fd CROSS JOIN LATERAL jsonb_array_elements(trud_arr) AS trud_elem LEFT JOIN LATERAL jsonb_array_elements( - CASE - WHEN jsonb_typeof(trud_elem -> 'svedUhodReb') = 'array' - THEN trud_elem -> 'svedUhodReb' - ELSE '[]'::jsonb - END) AS uhod_elem - ON true; + CASE + WHEN jsonb_typeof(trud_elem -> 'svedUhodReb') = 'array' + THEN trud_elem -> 'svedUhodReb' + ELSE '[]'::jsonb + END) AS uhod_elem + ON true; Y diff --git a/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_delta.hpl b/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_delta.hpl index f479c8b..c3265b1 100644 --- a/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_delta.hpl +++ b/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_delta.hpl @@ -360,7 +360,8 @@ and recruitment_id = '${IDM_ID}'; ervu-dashboard N - WITH filteredData AS (SELECT ri.recruit_id, + + WITH filtered_data AS (SELECT ri.recruit_id, ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' as trud_arr, ctid FROM ervu_dashboard.recruits_info ri @@ -377,8 +378,8 @@ SELECT fd.recruit_id, coalesce((trud_elem ->> 'prAktMestRab') = '1', false) AS actual_employer, to_date(uhod_elem ->> 'dataNachUhodReb', 'YYYY-MM-DD') AS parental_leave_start_date, to_date(uhod_elem ->> 'dataKonUhodReb', 'YYYY-MM-DD') AS parental_leave_end_date, - fd.ctid = (select max(ctid) from filteredData) as last_row -FROM filteredData fd + fd.ctid = (select max(ctid) from filtered_data) as last_row +FROM filtered_data fd CROSS JOIN LATERAL jsonb_array_elements(trud_arr) AS trud_elem LEFT JOIN LATERAL jsonb_array_elements( CASE diff --git a/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_repeat.hpl b/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_repeat.hpl index 8b12e18..6068d2d 100644 --- a/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_repeat.hpl +++ b/mappings/info_recruits/citizen_tables/work/work_activity/parallel/work_activity_flow_repeat.hpl @@ -358,7 +358,8 @@ and recruitment_id = '${IDM_ID}'; ervu-dashboard N - WITH filteredData AS (SELECT ri.recruit_id, + + WITH filtered_data AS (SELECT ri.recruit_id, ri.info -> 'svedFL' -> 'svedTrud' -> 'trudDeyat' as trud_arr, ctid FROM ervu_dashboard.recruits_info ri @@ -375,8 +376,8 @@ SELECT fd.recruit_id, coalesce((trud_elem ->> 'prAktMestRab') = '1', false) AS actual_employer, to_date(uhod_elem ->> 'dataNachUhodReb', 'YYYY-MM-DD') AS parental_leave_start_date, to_date(uhod_elem ->> 'dataKonUhodReb', 'YYYY-MM-DD') AS parental_leave_end_date, - fd.ctid = (select max(ctid) from filteredData) as last_row -FROM filteredData fd + fd.ctid = (select max(ctid) from filtered_data) as last_row +FROM filtered_data fd CROSS JOIN LATERAL jsonb_array_elements(trud_arr) AS trud_elem LEFT JOIN LATERAL jsonb_array_elements( CASE