Reshapes
← Relifold documentation

Distribute

Route each row to one or more output Spaces.

Distribute sends every row to the output Spaces returned by a deterministic routing function.

Worked example

Distribute(
    name="route-by-market",
    input_spaces=("news",),
    output_spaces=("us-news", "eu-news", "global-news"),
    distribute_by=target_markets,
)
ParameterDefaultMeaning
input_spacesrequiredThe Space or Spaces read by the reshape.
namerequiredA stable node name shown in the pipeline and session.
output_spacesrequiredEvery allowed destination Space.
distribute_byrequiredA callable from one row to one or more declared destination names.

Output

Each input row appears in every destination returned for it.

Design guidance

A row may be sent to several outputs, so Distribute is not necessarily a partition.