Updated on 2024-07-19 GMT+08:00

Constant Field Addition

Overview

The Add Constants operator generates constant fields.

Input and Output

  • Input: none
  • Output: constant fields

Parameter Description

Table 1 Operator parameters description

Parameter

Description

Type

Mandatory

Default Value

Constant fields

Information about constant fields:

  • output field name: Names of the configured fields.
  • type: field type
  • date format: If the field type is DATE, TIME, or TIMESTAMP, you need to specify the time format. If the field type is neither of them, the time format is invalid. The example time format is yyyyMMdd HH:mm:ss.
  • length: Field value length. If the actual field value is excessively long, the value is cut based on the configured length. When type is set to CHAR, spaces are added to the field value for supplement if the actual field value length is less than the configured length. When type is set to VARCHAR, no space is added to the field value for supplement if the actual field value length is less than the configured length.
  • constant value: Constant value of the correct type.

map

Yes

None

Data Processing Rule

This operator generates constant fields of the specified type.

Example

Use the CSV File Input operator to generate two fields A and B.

The following figure shows the source file.

Configure the Add Constants operator to add fields C and D.

After adding the constants, fields A, B, C, and D are generated, as shown in the following figure.