You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `FORK` processing command feeds the input rows into multiple execution
20
-
branches and outputs the results into a single table, with a discriminator column (`_fork`) to identify which branch each row came from.
21
-
22
-
The values of the discriminator column `_fork` are `fork1`, `fork2`, etc. and
23
-
they designate which `FORK` branch the current row comes from.
24
-
The values of the `_fork` column always start with `fork1`, which indicates that
25
-
the row comes from the first branch.
26
-
27
-
`FORK`branches can output different columns, but columns with the
28
-
same name must have the same data type across all branches.
29
-
30
-
When a column does not exist in a `FORK` branch, but it exists in the output of
31
-
other branches, `FORK` will add `null` values to the rows that have missing
32
-
columns.
33
-
34
-
`FORK`preserves the order of the rows from each subset, but it does not
35
-
guarantee that the rows will follow the same order in which the `FORK` branches
36
-
are defined. The rows from the first branch can be interleaved with the rows
37
-
from subsequent branches. Use `SORT _fork` after `FORK` if you need to change
38
-
this behaviour.
39
-
40
-
`FORK`branches receive an implicit `LIMIT 1000` if no `LIMIT` is provided.
19
+
The `FORK` processing command creates multiple execution branches to operate
20
+
on the same input data and combines the results in a single output table. A discriminator column (`_fork`) is added to identify which branch each row came from.
21
+
22
+
**Branch identification:**
23
+
- The `_fork` column identifies each branch with values like `fork1`, `fork2`, `fork3`
24
+
- Values correspond to the order branches are defined
25
+
- `fork1`always indicates the first branch
26
+
27
+
**Column handling:**
28
+
- `FORK`branches can output different columns
29
+
- Columns with the same name must have the same data type across all branches
30
+
- Missing columns are filled with `null` values
31
+
32
+
**Row ordering:**
33
+
- `FORK`preserves row order within each branch
34
+
- Rows from different branches may be interleaved
35
+
- Use `SORT _fork` to group results by branch
36
+
37
+
::::{note}
38
+
`FORK`branches default to `LIMIT 1000` if no `LIMIT` is provided.
0 commit comments