pub enum Plan {
Source(String),
Join {
left: Box<Plan>,
right: Box<Plan>,
join_key: String,
kind: JoinKind,
},
Filter {
input: Box<Plan>,
predicate: String,
},
Project {
input: Box<Plan>,
star: bool,
items: Vec<Proj>,
},
Aggregate {
input: Box<Plan>,
time_column: String,
window: Win,
group_by: Vec<String>,
pre: Vec<Proj>,
aggs: Vec<AggSpec>,
post: Vec<Proj>,
trigger: Option<Trigger>,
},
TopN {
input: Box<Plan>,
group_by: Vec<String>,
order_by: String,
tie_by: Option<String>,
descending: bool,
n: usize,
},
Named {
name: String,
input: Box<Plan>,
},
Sink {
input: Box<Plan>,
name: String,
},
}Expand description
The typed logical plan. 5c-i covers the stateless shape (source → filter → project → sink); 5c-ii adds the windowed aggregate, the updating aggregate, and the joins.
Variants§
Source(String)
FROM <dataset> — a source dataset by name.
Join
FROM <left> JOIN <right> ON <key> [interval] — a two-input join.
Filter
WHERE <predicate> — the predicate as a value-dialect string.
Project
SELECT …. star = SELECT * (pass-through, no step); else the projected columns.
Aggregate
SELECT … FROM … GROUP BY <window-fn>(ts,…), <keys> — a windowed keyed aggregate. A
Some(trigger) makes it the 5a updating aggregate (early firing).
Fields
window: Winpre: Vec<Proj>Pre-aggregate computed columns (an aggregate’s expression argument, e.g. a CASE fed to
count(DISTINCT …)) — lowered to applyExpression steps BEFORE the aggregate.
TopN
SELECT … FROM (SELECT …, ROW_NUMBER() OVER (PARTITION BY g ORDER BY c [DESC]) AS rn FROM s) WHERE rn <= n — the streaming top-N idiom → the topN operator.
Fields
Named
A CTE (WITH <name> AS (<subquery>)): the sub-plan input materialises as its own stage
under name, and downstream references to name read that stage. The multi-stage boundary —
the SQL equivalent of a named intermediate dataset in the TOML [[transforms]] DAG.
Sink
INSERT INTO <dataset> — the terminal sink dataset by name.
Trait Implementations§
impl StructuralPartialEq for Plan
Auto Trait Implementations§
impl Freeze for Plan
impl RefUnwindSafe for Plan
impl Send for Plan
impl Sync for Plan
impl Unpin for Plan
impl UnsafeUnpin for Plan
impl UnwindSafe for Plan
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request