This topic describes the definition of merge nodes and how to create a merge node and define the merging logic. This topic also provides an example to show the scheduling configuration and running details of a merge node.
You cannot change the running status of a merge node. A merge node merges the running results of multiple child nodes of a branch node and sets the running status to Successful. To ensure the proper running of a node that depends on the output of the child nodes of a branch node, you can configure the node to directly depend on a merge node.
For example, Branch node C has two logically exclusive branches C1 and C2. These two branches use different logic to write data to the same MaxCompute table. Assume that Node B depends on the output of this MaxCompute table. To ensure that Node B can be run as expected, you must use Merge node J to merge the running results of branches C1 and C2, and then configure Merge node J as the parent node of Node B. If Node B directly depends on branches C1 and C2, one of the branches will fail to be run because only one branch meets the branch condition each time Branch node C is run. In this case, Node B and its descendant nodes cannot be triggered as scheduled.
Create a merge node
- Go to the DataStudio page.
- Log on to the DataWorks console.
- In the left-side navigation pane, click Workspaces.
- In the top navigation bar, select the region where your workspace resides, find the workspace, and then click Data Analytics in the Actions column.
- Move the pointer over the icon and choose .
- In the Create Node dialog box, set the Node Name and Location parameters.
Note The node name must be 1 to 128 characters in length and can contain letters, digits, underscores (_), and periods (.).
- Click Commit.
Define the merging logic
After the merge node is created, the node configuration tab appears. Specify the branches to be merged for the node. Enter the output name or output table name of each parent node, and click the Add icon. You can view the running status in the Result section. The available running states are Failed, Successful, and Branch Not Running.
On the node configuration tab, click the Properties tab in the right-side navigation pane. Configure the scheduling properties of the merge node.
Example of the merge node
The condition of Branch_1 is met. The child node of this branch is run. You can select the branch and view the running details of the child node on the Runtime Log tab.
The condition of Branch_2 is not met. The child node of this branch is skipped. You can select the branch and view relevant information on the Runtime Log tab.
The child node of the merge node is run as expected.