Expand description
Compile a windowed streaming SQL query into a WindowExecutionSpec.
Supports the canonical keyed windowed-aggregation shape:
SELECT key, AGG(col) AS out [, ...]
FROM TUMBLE(TABLE src, DESCRIPTOR(ts), <size>) -- or HOP / SESSION
GROUP BY key, window_start, window_end§One SQL front door (Phase 60)
Streaming and batch share one front door for the window TVF and one parse of the query:
- The window TVF is rewritten to a subquery exactly once by
rewrite_window_tvfs(streaming_tvf.rs) — the same rewrite the batch planner consumes, soTUMBLE/HOP/SESSIONhas a single canonical lowering, not one for batch and another hand-rolled for streaming. - The rewritten SQL is parsed once with the front-door dialect
(
DuckDbDialect, matchingSqlEngine’ssql_parser.dialect). Parsing streaming SQL with a different dialect than batch was the divergence class behind theSUM(CASE WHEN …)409 in prod; a single dialect closes it structurally. - Everything the operator needs — the window kind/size/slide/gap, the event
time column, the grouping key, and the aggregate list — is derived from
that one parsed plan. Window recognition is now structural: “does the
parsed plan carry a
window_startboundary projection over a recognised window function?”, soSqlError::Unsupportedmeans “the planner cannot lower this shape to a continuous plan”, not “a text matcher failed to recognise the SQL”.
The dataflow ContinuousWindowExecutor still computes the aggregation from
the resulting WindowExecutionSpec; consuming DataFusion’s own
LogicalPlan (rather than the shared sqlparser AST) is the deeper
unification that grows with Phase 55’s operator coverage.
Structs§
- Streaming
Window Plan - A compiled windowed streaming plan: the operator spec plus the name of the source table the window reads from.
Functions§
- compile_
streaming_ window_ sql - Compile a windowed streaming SQL query into a
StreamingWindowPlan. - is_
windowed_ streaming_ sql - Returns
truewhensqlcontains a TUMBLE/HOP/SESSION window TVF.