From 237a6ed609f7f5d1da6226879ba7d6c40963b9bb Mon Sep 17 00:00:00 2001 From: Fusionshh Date: Tue, 18 Nov 2025 11:31:38 +0300 Subject: [PATCH] lots of fixes --- .../parallel/border_crossing_flow.hpl | 180 +++++++++--------- 1 file changed, 91 insertions(+), 89 deletions(-) diff --git a/mappings/info_recruits/citizen_tables/border_crossing/parallel/border_crossing_flow.hpl b/mappings/info_recruits/citizen_tables/border_crossing/parallel/border_crossing_flow.hpl index 2b3b647..d20ecef 100644 --- a/mappings/info_recruits/citizen_tables/border_crossing/parallel/border_crossing_flow.hpl +++ b/mappings/info_recruits/citizen_tables/border_crossing/parallel/border_crossing_flow.hpl @@ -18,103 +18,71 @@ 2025/08/05 14:31:22.799 - - 251 - 232 - 201 - 90 - 58 - 14 - N - 90 - 58 - 14 - N - Segoe UI - 9 - 294 - 176 - 576 - + - - -1. Table_input: - - string_agg же создаст перечисление дат в формате строки через запятую, как это планируеться приводить в дату и в дальнейшем инсертить в бд? - - is_border_crossed, Почему сразу не передавать true? - - зачем join на citizen, если у recruits_info уже есть поля айди военкомата? - - Зачем на уровне первичного flow, условие на дату в части created_at? - - в части where идет отбращшение к lateral elem, т.е предполагаеться что массив будет развернут до выполнения where, что будет если в исходных данных вместо массива будет null? - - elem ->> 'dataVyezd' вернет 'null', это не sql NULL, условие IS NOT NULL не отработает. - - Для чего групировка и в input и далее после table output? - - Детектить пустой стрим, можно сразу после инпута? почему пытаемся детектить только после апдейта? -2. Table_output: - - error_code нет смысла указывать в рамках error handling, под него нет колонки -3. Update: - - не указан error_description в error handling , в случае ошибки произойдет еще ошибка при попытке выполнения change job status on error - - - 1030 - - Create job execution record - Table input + сreate_job_execution_record_BC + table_input_BC Y - Filter rows - Change job status on success + filter_last_row_BC + change_job_status_on_success_BC Y - Detect empty stream - Change job status on success + detect_empty_stream_BC + change_job_status_on_success_BC Y - Change job status on error - Abort + change_job_status_on_error_BC + abort_BC Y - Table output - Change job status on error + table_output_BC + change_job_status_on_error_BC Y - Update - Change job status on error + update_citizen_BC + change_job_status_on_error_BC Y - sort_by_recruit_id - Update + sort_by_recruit_id_BC + update_citizen_BC Y - Table output - Filter rows + table_output_BC + filter_last_row_BC Y - Table input - Detect empty stream + Identify_last_row_BC + detect_empty_stream_BC Y - Table input - sort_by_recruit_id + Identify_last_row_BC + sort_by_recruit_id_BC Y - Table input - Table output + Identify_last_row_BC + table_output_BC + Y + + + table_input_BC + Identify_last_row_BC Y - Abort + abort_BC Abort Y @@ -126,15 +94,16 @@ ABORT_WITH_ERROR Y + 0 - 1200 + 1280 480 - Change job status on error + change_job_status_on_error_BC ExecSql Y @@ -150,8 +119,11 @@ ervu-dashboard + Y + N + Y Y N @@ -163,14 +135,15 @@ WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; + - 1024 + 1104 480 - Change job status on success + change_job_status_on_success_BC ExecSql Y @@ -183,8 +156,11 @@ and recruitment_id = '${IDM_ID}'; ervu-dashboard + Y + N + Y N N @@ -195,14 +171,15 @@ WHERE job_name = '${JOB_NAME}' and recruitment_id = '${IDM_ID}'; + - 1200 - 192 + 1280 + 176 - Create job execution record + сreate_job_execution_record_BC ExecSql Y @@ -215,8 +192,11 @@ and recruitment_id = '${IDM_ID}'; ervu-dashboard + N + N + Y N N @@ -224,6 +204,7 @@ and recruitment_id = '${IDM_ID}'; VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); + 288 @@ -231,7 +212,7 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - Detect empty stream + detect_empty_stream_BC DetectEmptyStream Y @@ -243,12 +224,12 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - 496 - 192 + 640 + 176 - Filter rows + filter_last_row_BC FilterRows Y @@ -276,18 +257,18 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); - Change job status on success + change_job_status_on_success_BC - 1200 + 1280 320 - Table input + table_input_BC TableInput - N + Y 1 @@ -298,16 +279,14 @@ VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}'); N WITH filteredData AS (SELECT ri.recruit_id, - ri.info->'svedFL'->'extend'->'svedPeresechGran' as border_cross_arr, - ctid + ri.info->'svedFL'->'extend'->'svedPeresechGran' as border_cross_arr FROM ervu_dashboard.recruits_info ri WHERE jsonb_typeof(ri.info->'svedFL'->'extend'->'svedPeresechGran') = 'array' AND coalesce(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}' ) SELECT to_date(border_cross_elem->>'dataVyezd' , 'YYYY-MM-DD') as date_crossing, to_date(border_cross_elem->>'dataVozvrashh' , 'YYYY-MM-DD') as return_date, - true as border_crossed, - fd.ctid = (select max(ctid) from filteredData) as last_row + true as border_crossed FROM filteredData fd CROSS JOIN LATERAL jsonb_array_elements(border_cross_arr) AS border_cross_elem; Y @@ -318,7 +297,7 @@ FROM filteredData fd - Table output + table_output_BC TableOutput Y @@ -348,23 +327,26 @@ FROM filteredData fd N N N + Y + N ervu_dashboard Y border_crossing
+ N Y N Y - 784 + 912 320
- Update + update_citizen_BC Update Y @@ -377,11 +359,13 @@ FROM filteredData fd 10000 ervu-dashboard Y + = recruit_id recruit_id + ervu_dashboard citizen
@@ -394,12 +378,12 @@ FROM filteredData fd Y - 784 + 912 480
- sort_by_recruit_id + sort_by_recruit_id_BC SortRows Y @@ -428,14 +412,32 @@ FROM filteredData fd - 496 + 640 480 + + Identify_last_row_BC + DetectLastRow + + N + + 1 + + none + + + result + + + 640 + 320 + + - Table output - Change job status on error + table_output_BC + change_job_status_on_error_BC Y error_description @@ -446,8 +448,8 @@ FROM filteredData fd - Update - Change job status on error + update_citizen_BC + change_job_status_on_error_BC Y error_description