Skip to content

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

Draft
antiguru wants to merge 2 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 2 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
@antiguru
antiguru force-pushed the columnar-ta-temporal-bucket-reencode branch from 9978083 to 038ee6e 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-ta-temporal-bucket-reencode branch from 038ee6e to d5f9095 Compare July 22, 2026 16:24
@antiguru
antiguru force-pushed the columnar-tb-join-accumulator branch from 083529c to d299f39 Compare July 22, 2026 16:24
antiguru and others added 2 commits July 22, 2026 19:42
`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>
@antiguru
antiguru force-pushed the columnar-tb-join-accumulator branch from d299f39 to 9a534cc Compare July 22, 2026 17:50
@antiguru
antiguru force-pushed the columnar-ta-temporal-bucket-reencode branch from d5f9095 to 49c35f9 Compare July 22, 2026 17:51
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