Skip to content

Commit 310ba0c

Browse files
antiguruclaude
andcommitted
compute: Retire the concat_many mixed-variant branch
Every producer now emits the columnar edge, so `concat_many` can never receive a `Vec` input. Remove the mixed-variant upgrade branch (the `vec_to_columnar` upgrade) and the now-unreachable all-`Vec` branch, leaving only the native all-columnar concatenation. The enum still carries a `Vec` arm until the collapse, so the input match type-handles `CollectionEdge::Vec` with an `unreachable!`. Removing the last branch that constructed a `Vec` edge leaves the variant unconstructed, so it carries `#[allow(dead_code)]`; the arm, the attribute, and the `unreachable!` are removed together when the enum collapses to a columnar alias. `vec_to_columnar` stays, still used by the leaf-encodes (imports, join no-closure, temporal bucketing, LetRec). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b045d8b commit 310ba0c

1 file changed

Lines changed: 17 additions & 19 deletions

File tree

‎src/compute/src/render/columnar.rs‎

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ pub type ColumnarCollection<'scope, T, D, R> = Collection<'scope, T, Column<(D,
6464
/// `concat`s repack the row-based inputs and produce the columnar variant.
6565
#[derive(Clone)]
6666
pub enum CollectionEdge<'scope, T: RenderTimestamp> {
67-
/// Row-formatted collection. Today's default for every producer.
67+
/// Row-formatted collection. No producer constructs this after the
68+
/// migration; the variant and its remaining match arms are removed when the
69+
/// enum collapses to a columnar alias.
70+
#[allow(dead_code)]
6871
Vec(VecCollection<'scope, T, Row, Diff>),
6972
/// Columnar collection. Currently unused by any producer; reserved for the
7073
/// producer flip at the end of the migration.
@@ -122,28 +125,23 @@ impl<'scope, T: RenderTimestamp> CollectionEdge<'scope, T> {
122125

123126
/// Concatenates a collection of edges.
124127
///
125-
/// Edges of one shared variant concatenate natively. Mixed inputs upgrade
126-
/// the row-based edges through [`vec_to_columnar`] and produce the
127-
/// columnar variant. Repacking rows into columns copies bytes but
128-
/// allocates no per-record `Row`s, so upgrading is the cheap direction.
128+
/// Every producer emits the columnar variant, so the inputs concatenate
129+
/// natively into the columnar variant.
129130
pub fn concat_many<I>(scope: Scope<'scope, T>, edges: I) -> Self
130131
where
131132
I: IntoIterator<Item = Self>,
132133
{
133-
let mut vecs = Vec::new();
134-
let mut cols = Vec::new();
135-
for edge in edges {
136-
match edge {
137-
CollectionEdge::Vec(c) => vecs.push(c),
138-
CollectionEdge::Columnar(c) => cols.push(c),
139-
}
140-
}
141-
if cols.is_empty() {
142-
CollectionEdge::Vec(differential_dataflow::collection::concatenate(scope, vecs))
143-
} else {
144-
cols.extend(vecs.into_iter().map(vec_to_columnar));
145-
CollectionEdge::Columnar(differential_dataflow::collection::concatenate(scope, cols))
146-
}
134+
let cols = edges.into_iter().map(|edge| match edge {
135+
CollectionEdge::Columnar(c) => c,
136+
// No producer emits `Vec` after the migration, so a `Vec` input
137+
// cannot reach here. The `Vec` arm and this `unreachable!` are
138+
// removed together when the enum collapses to a columnar alias.
139+
CollectionEdge::Vec(_) => unreachable!("no producer emits a `Vec` edge"),
140+
});
141+
CollectionEdge::Columnar(differential_dataflow::collection::concatenate(
142+
scope,
143+
cols.collect::<Vec<_>>(),
144+
))
147145
}
148146

149147
/// Applies `logic` to each record in this edge, exposing the record as a

0 commit comments

Comments
 (0)