Updated on 2022-09-15 GMT+08:00

Update Fields Operator

Overview

The Update Fields operator updates fields values when certain conditions are met.

The types supported at present include BIGINT, DECIMAL, DOUBLE, FLOAT, INTEGER, SMALLINT, and VARCHAR. When the type is VARCHAR and the operator is +, strings will be added to the end of field values. The operator - is not supported. For other types, + and - indicate addition and subtraction of values. For all types, = indicates new value assignment.

Input and Output

Input: field

Output: input field

Parameter Description

Table 1 Operator parameters description

Parameter

Description

Type

Mandatory

Default Value

update field name

Fields to be updated

string

Yes

None

update operator

Operator, which can be +, -, or =.

enum

Yes

+

update value

Values to be updated

The type is the same as the field type.

No

None

Condition logic connector

Condition logic connector. The options include AND and OR.

enum

Yes

AND

Conditions

Filter condition information:

  • input field name: Names of the input fields. Set this parameter to the names of the fields generated in the previous conversion step.
  • operator: Operator
  • comparative value. You can directly enter the value of a field referenced in the #{Existing field name} format.

map

Yes

None

Data Processing Rule

  • The operator checks whether conditions are met. If yes, the operator updates the field values. If no, the operator does not update the field values.
  • If the field values are digits, the updated values are digits.
  • If the fields are of the string type, the operator - cannot be used.

Example

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

The following figure shows the source file.

Configure the Update Fields operator to update a value by adding good to the end of the value if the value is test.

The following figure shows the output result.