A Route sends each record down one or more named branches. A Merge joins branches, or Sources, back into one stream. Reorder the conditions, switch the mode, and watch where each order goes, including the ones whose condition can't be worked out.
- type: route
name: classify
input: orders
config:
mode:
conditions:
default: standard
default branch.strategy: continue the record is dead-lettered and takes no branch at all, not even one already matched and not the default. Under fail_fast the run stops.country != "US" is true for an empty country, because != never gives null. See where does a null go?A Merge brings the branches back together, here straight from the Route's ports (in a real pipeline there is usually a Transform on each branch first). It doesn't match records up: it passes along everything from every input. How the inputs are mixed depends on mode:
inputs:. The same every run.interleave_seed: a mix that is the same every run, at the cost of reading every input into memory first. Meant for tests.exclusive, or remove the copies afterwards.All inputs must have the same columns; the Merge's columns come from its first input. A Merge never sorts: two sorted inputs concatenated are not one sorted stream. Put a sort_order on the Sink for that.
- type: merge
name: rejoin
inputs:
config:
mode:
A node reads one branch with input: classify.big, and the default branch the same way: input: classify.standard. A Merge lists branches in inputs:.
A node whose own name matches a branch can write input: classify, and it receives that branch. A Sink named big reading classify gets the big branch.
Several nodes can read the same branch; each gets every record on it.
Use names that differ from each other and from default. Today a default with the same name as a condition is folded into that condition's branch without an error, so its records can't be told apart.