Merge node
A merge node consolidates upstream run statuses to resolve dependency and triggering issues for nodes downstream from a branch node. Learn how to create a merge node, define its merge logic, and configure scheduling.
What is a merge node?
-
A merge node is a logical control node in Data Studio that consolidates the run statuses of upstream nodes, resolving dependency and triggering issues for downstream nodes of a branch node.
-
The resulting status of a merge node cannot be customized. When its conditions are met, the merge node always reports a successful status, allowing downstream nodes to depend on it without ambiguity.
For example, suppose branch node C has two mutually exclusive branches, C1 and C2, each writing to the same MaxCompute table with different logic. Downstream node B depends on this table's output. You must use a merge node J to consolidate the branches and make node B depend on J. If node B depends on C1 and C2 directly, the mutually exclusive branches cause a problem: the unselected branch always has the status Branch Not Selected. Node B inherits this status and is also skipped. This behavior propagates to all subsequent downstream nodes.
Prerequisites
The RAM user that you want to use is added to your workspace.
If you want to use a RAM user to develop tasks, you must add the RAM user to your workspace as a member and assign the Develop or Workspace Administrator role to the RAM user. The Workspace Administrator role has more permissions than necessary. Exercise caution when you assign the Workspace Administrator role. For more information about how to add a member and assign roles to the member, see Add members to a workspace.
-
A serverless resource group is associated with your workspace. For more information, see the topics in the Use serverless resource groups directory.
-
A merge node has been created. For more information, see Create nodes for a scheduling workflow.
Usage notes
Merge nodes are available only in DataWorks Standard Edition and higher. To purchase or upgrade, see DataWorks edition features.
Step 1: Develop a merge node
After creating a merge node, open its configuration page to define the merge logic.
-
In the merge logic definition section, search for and add the nodes that you want to merge. You can search by node output, node ID, or node name.
-
After you find a node, click the
icon to add it to the Merge Condition Settings section.NoteIf you need to merge multiple branch nodes, repeat this step for each node.
-
In MERGE Condition, configure the merge conditions for the branch nodes.
-
Merge logic conditions include:
-
AND: All upstream branch nodes must reach a terminal state (that is, they finish running), and all must meet their configured run statuses. Then, the status you set in Result is applied to the current node.
-
OR: All upstream nodes must reach a terminal state (that is, they finish running), and any branch node must meet its configured run status. Then, the status you set in Result is applied to the current node.
-
-
Node completion statuses include:
-
Successful: The node ran successfully.
-
Failed: The node failed to run.
-
Branch Not Selected: The node is not selected. It is marked as successful but does not actually run (a dry run).
NoteThis status applies only if the upstream node is a branch node.
-
-
-
In the Result section, set the run status for the current node.
NoteCurrently, you can only set the node's status to Successful.
For example:
-
Add nodes
branch1andbranch2as the upstream nodes of the current merge node. -
Set the running status of the node
Branch 1to Successful, Branch Not Running, or Failed. This means that the nodeBranch 1only needs to finish running. -
The running status of the node
Branch 2is set to Successful or Branch Not Running. This means that the nodeBranch 2has completed its run and Node B has not failed. -
The merge logic condition is set to AND.
The Successful run status of the current merge node takes effect only when the node
Branch 1completes its run, andBranch 2completes its run and does not fail. -
-
After you develop the merge node, click Scheduling Settings on the right side of the node configuration page to configure its scheduling properties. For more information, see Configure scheduling properties for a node.
Step 2: Publish and maintain the node
-
After you configure the scheduling properties, submit and publish the merge node to the production environment. For more information, see Deploy a node or workflow.
-
After a task is deployed, it runs periodically according to your scheduling configuration. Go to to view and manage the deployed periodic task. For more information, see Get started with Operation Center.