Customer Portal

Denormalize input file

Comments 1

  • Avatar
    avackova
    0
    Comment actions Permalink
    <?xml version="1.0" encoding="UTF-8"?>
    <Graph author="avackova" created="Mon May 05 08:57:00 CEST 2008" guiVersion="1.9" id="1209974901675" licenseType="Evaluation license." modified="Mon May 05 10:26:02 CEST 2008" modifiedBy="avackova" name="Denormalize" revision="1.18">
    <Global>
    <Metadata id="Metadata0">
    <Record fieldDelimiter="|" name="data" recordDelimiter="\n" type="delimited">
    <Field name="group" type="string"/>
    <Field name="value" type="string"/>
    </Record>
    </Metadata>
    </Global>
    <Phase number="0">
    <Node id="DATA_GENERATOR0" pattern="group1 " randomFields="value=random(&quot;2&quot;,&quot;5&quot;)" recordsNumber="10" type="DATA_GENERATOR"/>
    <Node id="DENORMALIZER0" key="group" type="DENORMALIZER">
    <attr name="denormalize"><![CDATA[//#TL
    string members="";

    function addInputRecord() {
    members = concat(members,$value,";");
    }

    function getOutputRecord() {
    string value = members;
    members = "";
    $group := $group;
    $value := value;
    }]]></attr>
    </Node>
    <Node id="EXT_SORT0" sortKey="group(a)" type="EXT_SORT"/>
    <Node debugPrint="true" id="TRASH0" type="TRASH"/>
    <Edge fromNode="DATA_GENERATOR0:0" id="Edge0" inPort="Port 0 (in)" metadata="Metadata0" outPort="Port 0 (out)" toNode="EXT_SORT0:0"/>
    <Edge fromNode="DENORMALIZER0:0" id="Edge1" inPort="Port 0 (in)" metadata="Metadata0" outPort="Port 0 (out)" toNode="TRASH0:0"/>
    <Edge fromNode="EXT_SORT0:0" id="Edge2" inPort="Port 0 (in)" metadata="Metadata0" outPort="Port 0 (out)" toNode="DENORMALIZER0:0"/>
    </Phase>
    </Graph>

    Node Denormalizer for each group with the same key (the same value of group data field) creates string containing all passed values; when whole group is read, it creates one output record putting on group data field value from group data field (the same for whole group) and on the value data field created string. For proper working Denormalizer needs sorted input.

Please sign in to leave a comment.