Setting output column with a constant - 7.3

tMap

Version
7.3
Language
English
Product
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
Module
Talend Studio
Content
Data Governance > Third-party systems > Processing components (Integration) > tMap
Data Quality and Preparation > Third-party systems > Processing components (Integration) > tMap
Design and Development > Third-party systems > Processing components (Integration) > tMap
Last publication date
2024-02-21

You can set a constant to an output column in the Expression Builder, without mapping from the input columns. As shown below, the company column of type String is set to a fixed value, Talend.

The input data will be transformed to output data after being processed into the tMap component.

Input table:

employee_id name
1 Elisa
2 Nicolas
3 Patrick

Output table:

employee_id name company
1 Elisa Talend
2 Nicolas Talend
3 Patrick Talend

The data type of the value in the Expression Builder should be consistent with the data type of the output column. Otherwise, it will throw a Java compilation error. For example, if a constant 1 is set for company column in the Expression Builder, it will throw a compilation error when the Job is executed: Type mismatch: cannot convert from int to String, because the data type of the company column is defined as type String, but an Integer/int value is set for this column.