<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
  <info><name>revenue-by-country-month</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>2026/11/19 10:00:00.000</created_date><modified_user>-</modified_user><modified_date>2026/11/19 10:00:00.000</modified_date></info>
  <notepads></notepads>
  <order><hop><from>Read orders</from><to>Paid only</to><enabled>Y</enabled></hop><hop><from>Paid only</from><to>Lookup country</to><enabled>Y</enabled></hop><hop><from>Read customers</from><to>Lookup country</to><enabled>Y</enabled></hop><hop><from>Lookup country</from><to>Month</to><enabled>Y</enabled></hop><hop><from>Month</from><to>Group by country and month</to><enabled>Y</enabled></hop><hop><from>Group by country and month</from><to>Sort</to><enabled>Y</enabled></hop><hop><from>Sort</from><to>Write CSV</to><enabled>Y</enabled></hop></order>
  <transform>
    <name>Read orders</name>
    <type>CSVInput</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning><method>none</method><schema_name/></partitioning>
    <filename>/var/tmp/battle/data/orders.csv</filename><filename_field/><rownum_field/><include_filename>N</include_filename>
    <separator>,</separator><enclosure>"</enclosure><header>Y</header><buffer_size>50000</buffer_size>
    <lazy_conversion>Y</lazy_conversion><add_filename_result>N</add_filename_result><parallel>N</parallel>
    <newline_possible>N</newline_possible><encoding>UTF-8</encoding>
    <fields><field><name>order_id</name><type>Integer</type><format></format><currency/><decimal>.</decimal><group/><length>-1</length><precision>-1</precision><trim_type>none</trim_type></field><field><name>customer_id</name><type>Integer</type><format></format><currency/><decimal>.</decimal><group/><length>-1</length><precision>-1</precision><trim_type>none</trim_type></field><field><name>order_date</name><type>String</type><format></format><currency/><decimal>.</decimal><group/><length>-1</length><precision>-1</precision><trim_type>none</trim_type></field><field><name>status</name><type>String</type><format></format><currency/><decimal>.</decimal><group/><length>-1</length><precision>-1</precision><trim_type>none</trim_type></field><field><name>amount</name><type>Number</type><format></format><currency/><decimal>.</decimal><group/><length>-1</length><precision>-1</precision><trim_type>none</trim_type></field></fields>
    <attributes/>
    <GUI><xloc>80</xloc><yloc>80</yloc></GUI>
  </transform>
  <transform>
    <name>Read customers</name>
    <type>CSVInput</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning><method>none</method><schema_name/></partitioning>
    <filename>/var/tmp/battle/data/customers.csv</filename><filename_field/><rownum_field/><include_filename>N</include_filename>
    <separator>,</separator><enclosure>"</enclosure><header>Y</header><buffer_size>50000</buffer_size>
    <lazy_conversion>Y</lazy_conversion><add_filename_result>N</add_filename_result><parallel>N</parallel>
    <newline_possible>N</newline_possible><encoding>UTF-8</encoding>
    <fields><field><name>customer_id</name><type>Integer</type><format></format><currency/><decimal>.</decimal><group/><length>-1</length><precision>-1</precision><trim_type>none</trim_type></field><field><name>name</name><type>String</type><format></format><currency/><decimal>.</decimal><group/><length>-1</length><precision>-1</precision><trim_type>none</trim_type></field><field><name>country</name><type>String</type><format></format><currency/><decimal>.</decimal><group/><length>-1</length><precision>-1</precision><trim_type>none</trim_type></field></fields>
    <attributes/>
    <GUI><xloc>80</xloc><yloc>288</yloc></GUI>
  </transform>
  <transform>
    <name>Paid only</name>
    <type>FilterRows</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning><method>none</method><schema_name/></partitioning>
    <send_true_to>Lookup country</send_true_to><send_false_to/>
    <compare><condition><negated>N</negated><leftvalue>status</leftvalue><function>=</function><rightvalue/>
      <value><name>constant</name><type>String</type><text>paid</text><length>-1</length><precision>-1</precision><isnull>N</isnull><mask/></value>
    </condition></compare>
    <attributes/>
    <GUI><xloc>272</xloc><yloc>80</yloc></GUI>
  </transform>
  <transform>
    <name>Lookup country</name>
    <type>StreamLookup</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning><method>none</method><schema_name/></partitioning>
    <from>Read customers</from><input_sorted>N</input_sorted><preserve_memory>Y</preserve_memory><sorted_list>N</sorted_list><integer_pair>N</integer_pair>
    <lookup><key><name>customer_id</name><field>customer_id</field></key>
      <value><name>country</name><rename>country</rename><default/><type>String</type></value></lookup>
    <attributes/>
    <GUI><xloc>464</xloc><yloc>80</yloc></GUI>
  </transform>
  <transform>
    <name>Month</name>
    <type>StringCut</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning><method>none</method><schema_name/></partitioning>
    <fields><field><in_stream_name>order_date</in_stream_name><out_stream_name>month</out_stream_name><cut_from>0</cut_from><cut_to>7</cut_to></field></fields>
    <attributes/>
    <GUI><xloc>656</xloc><yloc>80</yloc></GUI>
  </transform>
  <transform>
    <name>Group by country and month</name>
    <type>MemoryGroupBy</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning><method>none</method><schema_name/></partitioning>
    <fields>
      <field><aggregate>orders</aggregate><subject>order_id</subject><type>COUNT_ALL</type></field>
      <field><aggregate>revenue</aggregate><subject>amount</subject><type>SUM</type></field>
    </fields>
    <give_back_row>N</give_back_row>
    <group><field><name>country</name></field><field><name>month</name></field></group>
    <attributes/>
    <GUI><xloc>848</xloc><yloc>80</yloc></GUI>
  </transform>
  <transform>
    <name>Sort</name>
    <type>SortRows</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning><method>none</method><schema_name/></partitioning>
    <directory>%%java.io.tmpdir%%</directory><prefix>out</prefix><sort_size>1000000</sort_size><free_memory/><compress>N</compress><compress_variable/><unique_rows>N</unique_rows>
    <fields>
      <field><name>country</name><ascending>Y</ascending><case_sensitive>Y</case_sensitive><collator_enabled>N</collator_enabled><collator_strength>0</collator_strength><presorted>N</presorted></field>
      <field><name>month</name><ascending>Y</ascending><case_sensitive>Y</case_sensitive><collator_enabled>N</collator_enabled><collator_strength>0</collator_strength><presorted>N</presorted></field>
    </fields>
    <attributes/>
    <GUI><xloc>1040</xloc><yloc>80</yloc></GUI>
  </transform>
  <transform>
    <name>Write CSV</name>
    <type>TextFileOutput</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning><method>none</method><schema_name/></partitioning>
    <separator>,</separator><enclosure>"</enclosure><enclosure_forced>N</enclosure_forced><enclosure_fix_disabled>N</enclosure_fix_disabled>
    <header>Y</header><footer>N</footer><format>UNIX</format><compression>None</compression><encoding>UTF-8</encoding><endedLine/>
    <fileNameInField>N</fileNameInField><fileNameField/><create_parent_folder>Y</create_parent_folder>
    <file><name>/var/tmp/battle/out/hop_result</name><servlet_output>N</servlet_output><do_not_open_new_file_init>Y</do_not_open_new_file_init><extention>csv</extention><append>N</append><split>N</split><haspartno>N</haspartno><add_date>N</add_date><add_time>N</add_time><SpecifyFormat>N</SpecifyFormat><date_time_format/><add_to_result_filenames>N</add_to_result_filenames><pad>N</pad><fast_dump>N</fast_dump><splitevery/></file>
    <fields>
      <field><name>country</name><type>String</type><format/><currency/><decimal/><group/><nullif/><trim_type>none</trim_type><length>-1</length><precision>-1</precision></field>
      <field><name>month</name><type>String</type><format/><currency/><decimal/><group/><nullif/><trim_type>none</trim_type><length>-1</length><precision>-1</precision></field>
      <field><name>orders</name><type>Integer</type><format>0</format><currency/><decimal/><group/><nullif/><trim_type>none</trim_type><length>-1</length><precision>-1</precision></field>
      <field><name>revenue</name><type>Number</type><format>0.00</format><currency/><decimal>.</decimal><group/><nullif/><trim_type>none</trim_type><length>-1</length><precision>-1</precision></field>
    </fields>
    <attributes/>
    <GUI><xloc>1232</xloc><yloc>80</yloc></GUI>
  </transform>
  <transform_error_handling></transform_error_handling>
  <attributes/>
</pipeline>
