Skip to content

compute: columnar Constant output (P2)#37766

Draft
antiguru wants to merge 1 commit into
columnar-p1-get-mfp-outputfrom
columnar-p2-constant
Draft

compute: columnar Constant output (P2)#37766
antiguru wants to merge 1 commit into
columnar-p1-get-mfp-outputfrom
columnar-p2-constant

Conversation

@antiguru

Copy link
Copy Markdown
Member

Remove these sections if your commit already has a good description!

Motivation

Why does this change exist? Link to a GitHub issue, design doc, Slack
thread, or explain the problem in a sentence or two. A reviewer who has
no context should understand why after reading this section.

If this implements or addresses an existing issue, it's enough to link to that:
Closes
Fixes
etc.

Description

What does this PR actually do? Focus on the approach and any non-obvious
decisions. The diff shows the code --- use this space to explain what the
diff can't tell a reviewer.

Verification

How do you know this change is correct? Describe new or existing automated
tests, or manual steps you took.

Build the `Constant` arm of `render_plan_expr` into a `Column` and return a
`CollectionEdge::Columnar`, flipping the constant literal source to emit the
columnar edge. The err collection stays row-based (out of scope).

The rows go through a `ConsolidatingColumnBuilder` via `to_stream_with_builder`
rather than a direct columnar build. The planner (`FoldConstants`) consolidates
constant rows by `(row, time)` at optimization time, but this arm then advances
every time to `as_of`, which can collapse distinct original times onto one
time and so reintroduce duplicates at the same `(row, time)`. Consolidating here
folds those within the batch, matching the standing producer rule. The constant
rows are already owned, so the give is a move into staging, not a new
allocation. The `as_of` advancement and `until` filtering are unchanged.

Test: extends degenerate.slt with a constant carrying duplicate rows (asserting
multiplicity survives the columnar edge) and a constant feeding an indexed view
and an aggregate, exercising the columnar producer against ArrangeBy and Reduce
consumers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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