docs: propose operator flattening (#468) - #469
Conversation
Add a design proposal for merging the pre- and post-ASAP operator sets
into one Operator { Basic(OriginalOp), Ext(ASAPOp) } tree, and list it
in the proposals index.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
From #468, the essential change is to use one operator representation before and after ASAP optimization, so relational and summary operators can compose directly within the same DAG. Concretely, this means two things:
Optimization can then replace selected nodes while preserving the surrounding structure and sharing relationships: This goal does not require removing or redesigning per-node |
This is exactly what I want to do conceptually. I don't think the proposal is trying to "remove" or "redesign" the schema, timing and guarantee. I think it is just proposing how to implement that under the new operator definition. |
|
@Selvomega I think the proposed split comes from a useful distinction, but we should separate two design decisions: 1. Classify operators and expressions by their roles. Operators describe data flow between plan nodes; scalar expressions describe value computation inside an operator. For example, With that distinction,
These can be conceptual categories without requiring additional enum wrappers. All operators should use a common plan-node representation and child interface, preserving per-node schema, guarantee, and timing. 2. Treat summary optimization as selective subgraph replacement. These operator categories are not successive planning stages. When a rule applies and its semantic and accuracy requirements are satisfied, a relational or time-series operator/subgraph can be replaced with a subgraph containing summary operators. For example: The surrounding operators remain unchanged. The replacement must provide the output expected by its parent—for example, a percentile value from This keeps #468 focused on sharing operator definitions and removing the opaque |
Brings in #469, #470 (ExecutableDag -> PostAsapDag), #472 and #478. Conflict resolution: keep the #466 any_measure_filtered guard on the TopK site and adopt main's relaxed `TopK { k, .. }` pattern; keep the #466 corr FILTER test with main's comment wording. Two Aggregate constructions added by #472 gained the #466 `filters` field. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
What
Adds a design proposal for #468:
docs/design_docs/proposals/operator-flattening.md. Docs only.The proposal merges the pre- and post-ASAP operator sets into one tree:
Operator { Basic(OriginalOp), Ext(ASAPOp) }, where every operator's children areRc<Operator>. This removesKeepPreAsap, the duplicatedValueOperationoperators,SummaryNodeandSummarySchema, and with them the three problems in #468.Worth reviewing
QueryExpris split into operators (OriginalOp) and expressions (ScalarExpr).SummaryAgg/SummaryEstimatestore a guarantee; the rest is derived into aGuaranteeIndex.Column.dtypebecomesColumnType { DataType(..), ASAPType(..) }.maingreen.🤖 Generated with Claude Code