Setting default values in the schema of a component in a Job - 7.3

Talend Open Studio User Guide

Version
7.3
Language
English
Product
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Module
Talend Studio
Content
Design and Development
Last publication date
2023-10-11
Available in...

Open Studio for Big Data

Open Studio for Data Integration

Open Studio for ESB

About this task

You can set default values in the schema of certain components to replace null values retrieved from the data source.

Note:

At present, only tFileInputDelimited, tFileInputExcel, and tFixedFlowInput support default values in the schema.

In the following example, the company and city fields of some records of the source CSV file are left blank, as shown below. The input component reads data from the source file and completes the missing information using the default values set in the schema, Talend and Paris respectively.

id;firstName;lastName;company;city;phone
1;Michael;Jackson;IBM;Roma;2323
2;Elisa;Black;Microsoft;London;4499
3;Michael;Dujardin;;;8872
4;Marie;Dolvina;;;6655
5;Jean;Perfide;;;3344
6;Emilie;Taldor;Oracle;Madrid;2266
7;Anne-Laure;Paldufier;Apple;;4422

To set default values:

Procedure

  1. Double-click the input component tFileInputDelimited to show its Basic settings view.
    In this example, the metadata for the input component is stored in the Repository. For information about metadata creation in the Repository, see Centralizing database metadata.
  2. Click the [...] button next to Edit schema, and select the Change to built-in property option from the pop-up dialog box to open the schema editor.
  3. Enter Talend between quotation marks in the Default field for the company column, enter Paris between quotation marks in the Default field for the city column, and click OK to close the schema editor.
  4. Configure the output component tLogRow to display the execution result the way you want, and then run the Job.
    In the output data flow, the missing information is completed according to the set default values.