ReactiveDag.Node.Recompute.Union (reactive_dag v0.17.0-rc.4)

Copy Markdown View Source

Runs a union node: one row per (input cell, key) across several inputs, written into this node's own table.

Scoping

A claim on a union node carries its own provenance — the cell key is "<input>|<key>" — so a claim names exactly which input moved, and only that input is read. That is what makes N inputs safe here: nothing correlates across them, so a partial claim is not a partial answer (contrast a cross-node join, where a claim naming one side leaves the other unread and the fold writes nulls over good data).

A whole-cell claim reads every input, which is the only time it does.

What it reads

Each input's own rows, through ReactiveDag.Node.Rows — the resource and key derivation are stamped into meta.union_sources at graph assembly, since a recompute receives only its own cell and an input's resource is a cross-node fact.

This used to read the coordination tuple, back when an input might be a tableless verdict node with nowhere else to put its answer. Reading the resource means a union can project any column its inputs have, not just the tuple's fixed status.

Summary

Functions

The [{key, row}] pairs a union pass produces — the caller materialises them through the ordinary payload loop, so a union writes its rows exactly as any other node does.

Functions

pairs(spec, sources, claimed)

@spec pairs(map(), map(), [String.t()] | nil) :: {[{String.t(), map()}], map()}

The [{key, row}] pairs a union pass produces — the caller materialises them through the ordinary payload loop, so a union writes its rows exactly as any other node does.