Replicating the input data flow - 6.5

Talend Job Script Reference Guide

author
Talend Documentation Team
EnrichVersion
6.5
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Real-Time Big Data Platform
task
Design and Development > Designing Jobs
EnrichPlatform
Talend CommandLine
Talend Studio

Procedure

  1. Next to the tFileInputDelimited component definition, enter the following functions to add and label the tReplicate component.
    // replicate input data
    addComponent {
    	setComponentDefinition {
    		TYPE: "tReplicate",
    		NAME: "tReplicate_1",
    		POSITION: 288, 192
    	}
    	setSettings { 
    		LABEL : "replicate_flows"
    	}
    }
  2. Next to the setSettings {} function, enter an addSchema {} function and its addColumn {} sub-function to define the data structure of the output flows.

    As this component only passes on the schema of the input flow to the output flows, just copy the column definitions from the tFileInputDelimited component definition.

    addSchema {
    		NAME: "tReplicate_1",
    		CONNECTOR: "FLOW"
    		addColumn {
    			NAME: "name",
    			TYPE: "id_String"
    		}
    		addColumn {
    			NAME: "gender",
    			TYPE: "id_String"
    		}
    		addColumn {
    			NAME: "age",
    			TYPE: "id_Integer",
    			LENGTH: 2
    		}
    		addColumn {
    			NAME: "city",
    			TYPE: "id_String"
    		}
    		addColumn {
    			NAME: "marriageStatus",
    			TYPE: "id_String"
    		}
    	}