compute: bucket temporally on the columnar edge - #38371
Draft
antiguru wants to merge 1 commit into
Draft
Conversation
antiguru
force-pushed
the
columnar-tg-temporal-bucket-native
branch
from
August 20, 2026 12:58
d7c0cb0 to
b980c29
Compare
Temporal bucketing consumed and produced a `Vec` stream, so each of its four call sites decoded the columnar edge into it and re-encoded the result. The operator's own state was already columnar, since its bucket chain wraps `ColumnMergeBatcher`, so the round-trips existed only at its boundary. The operator now consumes and produces `Column`, and the four sites hand it the edge directly. Three per-record costs go with the round-trips: * The reveal path handed the builder owned tuples reconstituted from the chain's `Column` chunks. It now gives each chunk as a container. * `MergeBatcherWrapper::push_container` staged its `Vec` argument into a `Column` one record at a time before the chunker could read it. It takes a `Column` now, so the caller's buffer is what the chunker reads. * `Bucket::split` round-tripped the sealed chunks through a `Vec`, cloning every record on the way. It re-chunks the containers. The input side addresses records by index through a permutation rather than moving them, so neither the pass-through nor the bucket routing materializes an owned record. Records are partitioned before that permutation is sorted, because only the retained ones need ordering and in steady state the pass-through share is the larger one. `TemporalBucketing::bucket` returns `Self` rather than a chosen container, which lets a `Vec` stream and a columnar stream both implement it. The reduce key-value path keeps the `Vec` implementation, which stages through the columnar operator so there is one bucketing implementation rather than two. That path feeds an arrangement, and a re-encoding consumer is cheaper to hand moved allocations than copied bytes, so `MaybeBucketByTime` offers it as a separate `_vec` method rather than converting it.
antiguru
force-pushed
the
columnar-tg-temporal-bucket-native
branch
from
September 6, 2026 18:23
b980c29 to
e37c599
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes temporal bucketing columnar throughout, removing the four
Vecround-trips its call sites paid. The operator's state was already columnar, since its bucket chain wrapsColumnMergeBatcher, so the decode and re-encode existed only at its boundary.Three per-record costs go with the round-trips. The reveal path handed the output builder owned tuples reconstituted from the chain's
Columnchunks, and now gives each chunk as a container.MergeBatcherWrapper::push_containerstaged itsVecargument into aColumnone record at a time before the chunker could read it, and now takes aColumn.Bucket::splitround-tripped the sealed chunks through aVec, cloning every record, and now re-chunks the containers.On the input side, records are addressed by index through a permutation rather than moved, so neither the pass-through nor the bucket routing materializes an owned record. The partition happens before the sort, because only retained records need ordering and in steady state the pass-through share is the larger one.
TemporalBucketing::bucketnow returnsSelf, which lets aVecstream and a columnar stream both implement it. The reduce key-value path stays on theVecimplementation, which stages through the columnar operator so there is one bucketing implementation rather than two. It feeds an arrangement, and a consumer that re-encodes what it reads is cheaper to hand moved allocations than copied bytes.Worth knowing for review:
enable_compute_temporal_bucketingis compiled in asfalsebut served on in production, so this is a live path rather than a dormant one. CPU-213 tracks reconciling the default. Verified with the flag defaulted on, since the compiled-in default otherwise leaves the operator untested outsidetemporal_bucketing.slt.Posted by Claude Code