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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
//! Module: query::plan::expr
//! Responsibility: planner-owned expression and projection semantic contracts.
//! Does not own: expression execution, fingerprinting, or continuation wiring.
//! Boundary: additive semantic spine introduced without changing executor behavior.
//!
//! Pipeline contract:
//!
//! canonicalize -> type_inference:
//! - input: planner `Expr` trees after affine rewrite and boolean
//! canonicalization where boolean contexts use normalized `AND` / `OR`,
//! bounded searched-`CASE` lowering, and explicit truth-admission wrappers.
//! - output: the same expression shape plus the guarantee that boolean
//! normalization, CASE lowering, and constant boolean simplification are
//! owned upstream, not rediscovered by type inference.
//! - forbidden: type inference must not reorder boolean trees, lower CASE,
//! collapse truth wrappers, or choose runtime predicate coercions.
//! - ownership: canonicalize owns boolean shape/null-admission behavior;
//! type inference owns schema field resolution and coarse expression type
//! classification only.
//!
//! type_inference -> predicate_compile:
//! - input: canonical boolean expressions. Predicate subset derivation is
//! intentionally schema-independent, so it consumes `CanonicalExpr` rather
//! than `TypedExpr`; schema-aware legality remains owned by validation and
//! type inference.
//! - output: runtime `Predicate` shells or no predicate subset when the
//! normalized expression cannot be represented by the predicate runtime.
//! - forbidden: predicate compilation must not infer schema types, inspect
//! field models, re-run function argument typing, canonicalize expressions,
//! or rewrite expression shape.
//! - ownership: type inference owns type/nullability classification;
//! predicate compilation owns only compile-ready boolean-shape admission and
//! leaf-local runtime predicate coercion selection while lowering already
//! canonical compare/function leaves.
//!
//! predicate_compile -> projection_eval:
//! - input: projection evaluation receives already-bound scalar expression
//! arguments and builder preview expressions, not predicate compiler output.
//! - output: scalar `Value` results under SQL three-valued expression
//! semantics, preserving checked numeric failures for executor paths.
//! - forbidden: projection evaluation must not canonicalize expressions,
//! derive predicate subsets, normalize boolean trees, or import predicate
//! runtime semantics.
//! - ownership: predicate compilation owns predicate runtime shape;
//! projection evaluation owns scalar expression execution over values.
//!
//! Shared truth-value policy:
//! - `truth_value` owns TRUE-only admission for already-evaluated `Value`
//! results in boolean contexts such as CASE branch selection, HAVING/filter
//! evaluation, and aggregate FILTER checks.
//! - it is not a pipeline stage, does not rewrite expression shape, does not
//! infer types, and does not compile predicates.
//! - projection evaluation may call it only after materializing a condition
//! value; canonicalize and type inference must not call it.
//!
//! Stage artifacts:
//! - `CanonicalExpr` marks expressions that have crossed the canonicalization
//! boundary.
//! - `TypedExpr` marks expressions that have crossed the type-inference
//! boundary without allowing that stage to rewrite the expression tree.
//! - `PredicateCompilation` marks runtime predicates produced by predicate
//! compilation from `CanonicalExpr`.
//!
//! Existing planner surfaces still expose `Expr` and `Predicate` where broader
//! subsystem APIs require them, but each stage now creates an explicit artifact
//! at its boundary so future tightening can migrate callers without inventing
//! parallel stage contracts.
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use ;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use ;