Skip to content

compute: Take the linear-join accumulator off the collection edge - #37788

Draft
antiguru wants to merge 3 commits into
columnar-ta-temporal-bucket-reencodefrom
columnar-tb-join-accumulator
Draft

compute: Take the linear-join accumulator off the collection edge#37788
antiguru wants to merge 3 commits into
columnar-ta-temporal-bucket-reencodefrom
columnar-tb-join-accumulator

Conversation

@antiguru

@antiguru antiguru commented Jul 21, 2026

Copy link
Copy Markdown
Member

Move the linear-join multi-stage accumulator off the CollectionEdge onto a bare VecCollection, encoding to the columnar edge only at the join output. Removes an internal live Vec use of the edge.

Columnar dataflow-edge migration. Design doc: doc/developer/design/20260720_columnar_dataflow_edges.md (#37744).

Part of CPU-51.

@antiguru
antiguru force-pushed the columnar-tb-join-accumulator branch from 7323a80 to 083529c Compare July 22, 2026 08:41
@linear-code

linear-code Bot commented Jul 22, 2026

Copy link
Copy Markdown

CPU-51

@antiguru
antiguru force-pushed the columnar-tb-join-accumulator branch 2 times, most recently from d299f39 to 9a534cc Compare July 22, 2026 17:50
@antiguru
antiguru force-pushed the columnar-tb-join-accumulator branch from 9a534cc to 5f6e9e6 Compare August 19, 2026 12:01
@antiguru
antiguru force-pushed the columnar-tb-join-accumulator branch 2 times, most recently from 6eca1cf to ea1f3f4 Compare August 20, 2026 08:49
@antiguru
antiguru force-pushed the columnar-tb-join-accumulator branch from ea1f3f4 to 8808ba0 Compare August 20, 2026 09:13
antiguru and others added 3 commits September 6, 2026 17:12
`mz_join_core` is `Vec`-internal, so the linear join accumulates across
stages in a `VecCollection`. That intra-operator accumulator was wrapped
in the `CollectionEdge` enum (`JoinedFlavor::Collection(CollectionEdge)`,
whose `Vec` arm was the live accumulator), which conflated the inter-node
edge type with a purely local `Vec`.

Split `JoinedFlavor` so the collection edge appears only where it should:
`Edge(CollectionEdge)` is the stage-1 source input (a columnar edge from
an upstream producer), and `Collection(VecCollection)` is the bare
multi-stage accumulator. Stage 1 keys its source off the edge via
`arrange_join_input` (unchanged, both arms); subsequent stages arrange the
bare accumulator via the new `arrange_join_collection`. The two share the
`Vec` keying (`key_join_input_vec`) and the arrange tail
(`arrange_keyed_join_input`), so the source `Vec` arm and the accumulator
path cannot drift. Finalization (node P7) still encodes the output edge.

Behavior-preserving: the accumulator was already `Vec` at runtime, just
wrapped in `CollectionEdge::Vec`; this drops the wrapper. `mz_join_core`,
the source columnar path, and the output encoding are untouched, and all
operator names are preserved. After this, `JoinedFlavor::Collection` no
longer mentions `CollectionEdge`, so the enum collapse leaves the join
accumulator alone.

Adds `arrange_join_collection_matches_vec_edge` to guard the accumulator
wiring against the `Vec` edge arm.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment-only, no behavior change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The doc named the migration plan's node for the borrowed-push pattern. State the
property instead, which is what a caller needs to know.
@antiguru
antiguru force-pushed the columnar-tb-join-accumulator branch from 8808ba0 to b829158 Compare September 6, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant