1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Pipeline-level normalization passes.
//!
//! These passes transform a single `TypedPipeline` without generating CTEs.
//!
//! Contract: `Rc<TypedPipeline> -> Result<Rc<TypedPipeline>, Rc<TranslationError>>`
//!
//! Passes (in order):
//! - `normalize_within` - WITHIN → WHERE with explicit timestamp bounds
//! - `normalize_agg` - AGG compound identifiers → flat AGG + LET/DROP
//! - `normalize_window` - WINDOW compound identifiers → flat WINDOW + LET/DROP
//! - `extract_window_aggregates` - WINDOW nested aggregates → flat WINDOW + SELECT
//! - `normalize_explode` - EXPLODE compound identifiers → flat EXPLODE + LET/DROP
//! - `lower_unnest` - UNNEST → EXPLODE (if array) + LET + DROP
//! - `lower_parse` - PARSE → LET + WHERE (regex extraction + filter)
//! - `lower_nest` - NEST → SELECT with struct literal
//! - `expand_array_literals` - Expands array literal elements to match element type
//! - `fuse_projections` - Fuses LET/DROP/SELECT into minimal SELECT commands (must be last)
//! - `align_append_schema` - Inserts SELECT before APPEND to align to target schema (main pipeline only)
pub use align_append_schema;
pub use expand_array_literals;
pub use extract_window_aggregates;
pub use fuse_projections;
pub use lower_nest;
pub use lower_parse;
pub use lower_unnest;
pub use normalize_agg;
pub use normalize_explode;
pub use normalize_window;
pub use normalize_within;