Configure field calculation transformation component
The field calculation transformation component performs calculations on input fields and outputs the results.
Configure properties
-
On the top menu bar of the Dataphin homepage, choose Developer > Data Integration.
-
On the top menu bar of the integration page, select Project. (In Dev-Prod mode, select Environment).
-
In the left-side navigation pane, click Batch Pipeline. In the Batch Pipeline list, click the offline pipeline that you want to develop to open its configuration page.
-
Click Component Library in the upper-right corner of the page to open the Component Library panel.
-
In the left-side navigation pane of the Component Library panel, select Transform. Find the Field Calculation component in the list of transformation components on the right side, and drag it to the canvas.
-
Click and drag the
icon of the target upstream and downstream components to connect them to the current field calculation component. -
Click the
icon in the field calculation component card to open the Field Calculation Configuration dialog box. -
In the Field Calculation Configuration dialog box, set the parameters as follows:
Parameter
Description
Step Name
The name of the field calculation component. Dataphin automatically generates a step name, which you can modify as needed. The name must meet the following requirements:
-
It can contain only Chinese characters, English characters, underscores (_), and digits.
-
It can be up to 64 characters in length.
Time Zone Conversion
If your String type input and output fields store time data, specify the time zone for these fields.
-
Input Field String Time Zone: Applies when using functions to convert String data to Date type. Specifies the time zone of the source String data. Default: Asia/Shanghai.
-
Output Field String Time Zone: Applies when using functions to convert Date data to String type. Specifies the time zone for the output String data. Default: Asia/Shanghai.
Output Fields
Lists the output fields, including the ordinal number, field name (with table name if applicable), and type. You can perform the following operations:
-
New field: Manually add output fields by performing the following steps:
-
Click New Field.
-
In the New Field dialog box, configure the parameters.
-
Field name: Can contain only Chinese characters, English characters, underscores (_), and digits, and must be within 64 characters.
-
Data type: Includes String, Long, Double, Date, Boolean, and Bytes data types.
-
Function: Select a function from the list to use for field calculation. Click a function name to add it to the expression.
-
Expression: Combine functions and source fields to define the calculation logic for the new field.
-
Source field: Lists the upstream output fields. Click a field name to add it to the expression.
-
-
Click OK to create the new field.
-
-
Delete field: Click the icon in the Actions
column to delete an existing field. -
Sort fields: Drag the
icon to reorder the output fields.
-
-
Click Confirm to complete the property configuration of the Field Calculation transformation component.