This topic describes the definition of MERGE nodes and how to create a MERGE node and define the merging logic. It also provides an example to show the scheduling configuration and running details of a MERGE node.
A MERGE node is a logical control node in DataStudio. It can merge the running results of its parent nodes, regardless of their running statuses. It aims to facilitate the running of nodes that depend on the output of the child nodes of a branch node.
Currently, 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 guarantee 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 the 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 make sure that Node B can run properly, 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. Each time Branch node C runs, only one branch condition can be met and the corresponding child node is run. If Node B directly depends on branches C1 and C2 but one of the branch conditions is not met and the corresponding child node is not run, Node B cannot be triggered as scheduled.
Create a MERGE node
- Log on to the DataWorks console. In the left-side navigation pane, click Workspaces. On the Workspaces page, find the target workspace and click Data Analytics in the Actions column.
- On the Data Analytics tab that appears, move the pointer over the icon and choose
Alternatively, you can click a workflow in the left-side navigation pane, right-click General, and then choose .
- In the Create Node dialog box that appears, set Node Name and Location.
Note The node name must be 1 to 128 characters in length.
- 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 the parent node, and click the Add icon. You can view the running status in the Result section. Currently, the available running statuses are Successful and Branch Not Running.
Click the Properties tab in the right-side navigation pane to configure the scheduling properties of the MERGE node.
Example of the MERGE node
Run 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 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 runs properly.