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.

Note You can only use MERGE nodes in DataWorks Standard Edition or higher.

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

  1. 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.
  2. On the Data Analytics tab that appears, move the pointer over the Create icon icon and choose General > MERGE Nodes.

    Alternatively, you can click a workflow in the left-side navigation pane, right-click General, and then choose Create > MERGE Nodes.

  3. 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.
  4. 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

You can associate child nodes with different output results of a branch node to define the branches under different conditions. For example, in the workflow shown in the following figure, the branches Branch_1 and Branch_2 are defined as child nodes of the branch node.Example
Branch_1 depends on the output named autotest.fenzhi121902_1, as shown in the following figure.Dependency
Branch_2 depends on the output named autotest.fenzhi121902_2, as shown in the following figure.OutputBranch

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.