Skip to main content

How to use branching

The branch is a powerful way to split a query mid execution an operate on a stage in two different ways before joining the results back together. For example, you could run a specific filter in one branch and a totally different one in another, then further interact with each set of filtered data, before joining them back together in a single consolidated data set.

Branching is quite simple, you start a new branch using the branch command, then operate on that branch, start additional branches again with the branch command, and finally merge all branches back together using the mergebranches command.

Currently, nested branches (branches within a branch) will not work and will be treated as a top level branch. Also note that branches will run synchronously.


|| branch
|| filter "type == 'pokemon'"
|| addcolumn message "this is a pokemon: $name$"
|| branch
|| filter "type == 'digimon'"
|| addcolumn message "this is not a pokemon: $name$"
|| mergebranches