Defining the output component - 6.5

Talend Job Script Reference Guide

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
Talend CommandLine
Talend Studio
Design and Development > Designing Jobs

Follow the steps below to add and define the output component in this example, tFileOutputDelimited.


  1. Next to the tMap component definition, enter another addComponent {} function, and inside this function enter the setComponentDefinition {} function and its minimal required parameters to add the output component.
    addComponent {
    	setComponentDefinition {
    		TYPE: "tFileOutputDelimited",
    		NAME: "tFileOutputDelimited_1",
    		POSITION: 736, 256
  2. Next to the setComponentDefinition {} function, enter the setSettings {} function and parameters required to define the component properties:
    • The path to the output file

    • Whether to include the header in the output file

    • The encoding type of the output file

    • Whether to throw an error and stop Job execution if the specified output file already exists

    • The label of the component displayed in the generated Job on the design workspace

    	setSettings {
    		FILENAME : "\"E:/Talend/data/output/consolidated_list.csv\"",
    		INCLUDEHEADER : "true",
    		ENCODING : "\"UTF-8\"",
    		FILE_EXIST_EXCEPTION : "false",
    		LABEL : "consolidated_list"

    Be sure to use a backslash (\) when specifying a metacharacter.

  3. Next to the setSettings {} function, enter an addSchema {} function to define the schema of the output component.

    Note that the column definitions of this schema must be the same as those of the output schema defined in the preceding component, tMap.

    addSchema {
    		NAME: "tFileOutputDelimited_1",
    		LABEL: "out"
    		addColumn {
    			NAME: "id",
    			TYPE: "id_Integer",
    			LENGTH: 2
    		addColumn {
    			NAME: "full_name",
    			TYPE: "id_String"
    		addColumn {
    			NAME: "age",
    			TYPE: "id_Integer",
    			LENGTH: 2
    		addColumn {
    			NAME: "city",
    			TYPE: "id_String"