Skip to content

compute: columnar Get/Mfp output via as_collection_core - #37763

Draft
antiguru wants to merge 1 commit into
columnar-c2-flatmap-inputfrom
columnar-p1-get-mfp-output
Draft

compute: columnar Get/Mfp output via as_collection_core#37763
antiguru wants to merge 1 commit into
columnar-c2-flatmap-inputfrom
columnar-p1-get-mfp-output

Conversation

@antiguru

@antiguru antiguru commented Jul 20, 2026

Copy link
Copy Markdown
Member

First producer flip: Get/Mfp emit their output as the columnar edge via as_collection_core, building a ConsolidatingColumnBuilder so within-batch consolidation matches the prior ConsolidatingContainerBuilder.

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-p1-get-mfp-output branch 2 times, most recently from 8dab0e8 to 2e5920e 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-p1-get-mfp-output branch from 2e5920e to c420261 Compare July 22, 2026 16:24
@antiguru antiguru changed the title compute: columnar Get/Mfp output via as_collection_core (P1) compute: columnar Get/Mfp output via as_collection_core Jul 22, 2026
@antiguru
antiguru force-pushed the columnar-p1-get-mfp-output branch from c420261 to 47a405c Compare July 22, 2026 17:50
@antiguru
antiguru force-pushed the columnar-p1-get-mfp-output branch 2 times, most recently from 0a3b022 to 570a36a Compare August 19, 2026 13:17
@antiguru
antiguru force-pushed the columnar-p1-get-mfp-output branch from 570a36a to b01857d Compare August 20, 2026 08:49
@antiguru
antiguru force-pushed the columnar-p1-get-mfp-output branch from b01857d to 176a1c1 Compare August 20, 2026 09:13
Make `as_collection_core` build its ok output into a
`ConsolidatingColumnBuilder` and return a `CollectionEdge::Columnar`,
flipping the Get and Mfp producers to emit the columnar edge. This is the
first producer flip: the columnar arm goes live for Get/Mfp-fed edges,
which Wave 1 already made every consumer accept natively or decode only at
a sanctioned leaf.

Rework the identity fast-path so an unarranged trivial MFP hands the input
edge straight through (a columnar producer stays columnar with no
`ColumnarToVec` hop) instead of forcing `as_specific_collection` to decode
it to `Vec`. A keyed identity still reads its arrangement as a `Vec` edge.
`as_specific_collection` stays the row-based consumer leaf.

`ConsolidatingColumnBuilder` folds within-batch duplicates, matching the
row-based `ConsolidatingContainerBuilder` this replaced, and emits a
`Column` instead of a `Vec`. It stages owned `(Row, T, Diff)` tuples to
consolidate in place, so the producer gives its records owned.
`mfp_plan.evaluate` already produces a fresh owned `Row` per result, so
this is a move into staging, not a new allocation. The borrowed-push
no-owned-Row pattern is a consumer optimization for reading an existing
columnar batch; it never applied to a producer computing new rows.

The internal fueled `flat_map` chain (`CollectionBundle::flat_map`,
`ArrangementFlavor::flat_map`, `flat_map_core_fallible`, `PendingWork::
do_work`) carried a `PushInto<(D, T, Diff)>` bound that constrained the
element type up front. The bound was never exercised by those bodies (the
caller's `logic` performs the `give`), so relax it to `DCB:
ContainerBuilder` and drop the now-unused `D`, letting the producer choose
its own builder and push shape through the same fuel machinery.

Sink and `ensure_collections` temporal bucketing decode the produced edge
at their existing sanctioned leaves.

Tests: a `Get -> ArrangeBy` end-to-end unit test asserting the producer
emits columnar and the arrange input keeps the columnar passthrough; an
identity-fast-path test asserting the input edge variant is preserved; and
a within-batch consolidation test asserting duplicate output rows fold to a
single record with summed diff.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@antiguru
antiguru force-pushed the columnar-p1-get-mfp-output branch from 176a1c1 to 489ab17 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