pub enum Op {
Nop,
Seq(Vec<Op>),
Iterate {
source: DataSource,
body: Box<Op>,
},
Filter {
cond: Condition,
body: Box<Op>,
},
Insert {
relation: NameId,
args: Vec<Operand>,
},
Let {
var: NameId,
expr: Expr,
body: Box<Op>,
},
GroupBy {
source: NameId,
vars: Vec<NameId>,
keys: Vec<NameId>,
aggregates: Vec<Aggregate>,
body: Box<Op>,
},
HashJoin {
build_source: DataSource,
probe_source: DataSource,
join_keys: Vec<NameId>,
body: Box<Op>,
},
}Variants§
Nop
A no-op.
Seq(Vec<Op>)
Sequence of operations executed in order.
Iterate
Iterate over a data source.
For each tuple yielded by source, body is executed.
Variables defined in source are bound and available in body.
Filter
Filter / Check condition.
If cond evaluates to true, body is executed.
Insert
Insert a tuple into a relation.
All variables in args must be bound.
Let
Calculate a value and bind it to a variable.
let var = expr
GroupBy
GroupBy operation.
Scans source (binding columns to vars), groups by keys, computes aggregates
for each group, and then executes body for each group.
HashJoin
Hash join of two data sources on a shared set of variables.
Execution:
- Drain
build_source. For each tuple, capture the values bound bybuild_source’s vars (including the join-key positions) into an in-memory hash table keyed by thejoin_keysprojection. - Stream
probe_source. For each tuple, extract its join-key values and look up in the build hash table. For every matching build tuple, restore the build-side bindings alongside the probe-side bindings and executebody.
join_keys must be variables that both build_source.vars and
probe_source.vars bind. The planner only emits this op for 2-way
joins where neither side has a useful IndexLookup.