Operators
← Relifold documentation

Deterministic and reshape operations

Use ordinary code for exact logic and semantic models only for ambiguous meaning.

OperationPurpose
TransformMap each row with a trusted Python callable.
FilterKeep rows for which a callable returns true.
ClusterGroup values using a trusted pairwise predicate.
JoinJoin two Spaces using a trusted predicate.
AssignCreate labeled relationships between Spaces.
MatchingSelect a one-to-one matching.
RelateCreate labeled relationships within one Space.
SortOrder values using a trusted comparison.
TaxonomyCreate broader/narrower links using a trusted predicate.
HierarchyCreate a single-parent forest using a trusted predicate.
SelectKeep selected columns.
DropRemove selected columns.
FlattenExplode a list-valued field into rows.
TransposeSwap nested keyed levels.
UnionCombine Spaces and collapse equal keys.
DistributeRoute each row to one or more output Spaces.
ApplyRun a custom rows-to-rows reshape.
ScatterDeclare independent branches together.
BarrierWait for all preceding branches.
UnfoldApply a transformation recursively under explicit bounds.

Worked reshape

Union(
    name="combine-and-deduplicate",
    input_spaces=("web-products", "store-products"),
    output_space="products",
    key="sku",
    merge_policy={"inventory": "sum", "tags": "union"},
)

Flatten(
    name="one-interest-per-row",
    input_spaces=("user-profiles",),
    output_space="user-interests",
    field="event_interests",
    key="user_id",
)

Union is the correct zero-cost exact deduplication operation. Use SemCluster only when equality itself requires semantic judgment.