<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
  <info>
    <name>array_recruitments</name>
    <name_sync_with_filename>Y</name_sync_with_filename>
    <description/>
    <extended_description/>
    <pipeline_version/>
    <pipeline_type>Normal</pipeline_type>
    <parameters>
    </parameters>
    <capture_transform_performance>N</capture_transform_performance>
    <transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
    <transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
    <created_user>-</created_user>
    <created_date>2025/01/17 10:29:53.663</created_date>
    <modified_user>-</modified_user>
    <modified_date>2025/01/17 10:29:53.663</modified_date>
  </info>
  <notepads>
    <notepad>
      <backgroundcolorblue>251</backgroundcolorblue>
      <backgroundcolorgreen>232</backgroundcolorgreen>
      <backgroundcolorred>201</backgroundcolorred>
      <bordercolorblue>90</bordercolorblue>
      <bordercolorgreen>58</bordercolorgreen>
      <bordercolorred>14</bordercolorred>
      <fontbold>N</fontbold>
      <fontcolorblue>90</fontcolorblue>
      <fontcolorgreen>58</fontcolorgreen>
      <fontcolorred>14</fontcolorred>
      <fontitalic>N</fontitalic>
      <fontname>Segoe UI</fontname>
      <fontsize>9</fontsize>
      <height>42</height>
      <xloc>752</xloc>
      <yloc>128</yloc>
      <note>ARRAY_MIL_COM - алиас (массив idm_id всех военкоматов)
ARR_MC - параметр</note>
      <width>339</width>
    </notepad>
    <notepad>
      <backgroundcolorblue>251</backgroundcolorblue>
      <backgroundcolorgreen>232</backgroundcolorgreen>
      <backgroundcolorred>201</backgroundcolorred>
      <bordercolorblue>90</bordercolorblue>
      <bordercolorgreen>58</bordercolorgreen>
      <bordercolorred>14</bordercolorred>
      <fontbold>N</fontbold>
      <fontcolorblue>90</fontcolorblue>
      <fontcolorgreen>58</fontcolorgreen>
      <fontcolorred>14</fontcolorred>
      <fontitalic>N</fontitalic>
      <fontname>Segoe UI</fontname>
      <fontsize>9</fontsize>
      <height>26</height>
      <xloc>752</xloc>
      <yloc>192</yloc>
      <note>для запуска без параллели</note>
      <width>158</width>
    </notepad>
  </notepads>
  <order>
    <hop>
      <from>Table input</from>
      <to>Copy rows to result</to>
      <enabled>Y</enabled>
    </hop>
  </order>
  <transform>
    <name>Copy rows to result</name>
    <type>RowsToResult</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <attributes/>
    <GUI>
      <xloc>768</xloc>
      <yloc>336</yloc>
    </GUI>
  </transform>
  <transform>
    <name>Table input</name>
    <type>TableInput</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <connection>ervu-dashboard</connection>
    <execute_each_row>N</execute_each_row>
    <sql>WITH ids AS (
    SELECT idm_id, 
           (ROW_NUMBER() OVER ()) - 1 AS rn
    FROM ervu_dashboard.recruitment
    WHERE schema IN ('Department', 'Organization', 'Region')
    --LIMIT 200
)
SELECT array_agg(idm_id) AS ARRAY_MIL_COM
FROM ids
GROUP BY rn / 100;</sql>
    <variables_active>N</variables_active>
    <attributes/>
    <GUI>
      <xloc>512</xloc>
      <yloc>336</yloc>
    </GUI>
  </transform>
  <transform_error_handling>
  </transform_error_handling>
  <attributes/>
</pipeline>
