1#![warn(missing_debug_implementations)]
13
14use std::collections::BTreeSet;
15use std::ops::Deref;
16
17use mz_repr::GlobalId;
18use serde::{Deserialize, Serialize};
19
20mod id;
21mod interpret;
22mod linear;
23mod relation;
24mod scalar;
25
26pub mod explain;
27pub mod row;
28pub mod virtual_syntax;
29pub mod visit;
30
31pub use id::{Id, LocalId, SourceInstanceId};
32pub use interpret::{ColumnSpec, ColumnSpecs, Interpreter, ResultSpec, Trace, TraceSummary};
33pub use linear::plan::{MfpPlan, SafeMfpPlan};
34pub use linear::util::{join_permutations, permutation_for_arrangement};
35pub use linear::{MapFilterProject, memoize_expr};
36pub use relation::func::order_aggregate_datums as order_aggregate_datums_exported_for_benchmarking;
37pub use relation::func::{
38 AggregateFunc, AnalyzedRegex, AnalyzedRegexOpts, CaptureGroupDesc, LagLeadType,
39 NaiveOneByOneAggr, OneByOneAggr, TableFunc,
40};
41pub use relation::join_input_mapper::JoinInputMapper;
42pub use relation::{
43 AccessStrategy, AggregateExpr, CollectionPlan, ColumnOrder, JoinImplementation,
44 JoinInputCharacteristics, LetRecLimit, MirRelationExpr, RECURSION_LIMIT, RowSetFinishing,
45 RowSetFinishingIncremental, WindowFrame, WindowFrameBound, WindowFrameUnits, canonicalize,
46 compare_columns, non_nullable_columns,
47};
48pub use scalar::func::{self, BinaryFunc, UnaryFunc, UnmaterializableFunc, VariadicFunc};
49pub use scalar::{
50 EvalError, FilterCharacteristics, MirScalarExpr, ProtoDomainLimit, ProtoEvalError, like_pattern,
51};
52
53#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
56pub struct OptimizedMirRelationExpr(pub MirRelationExpr);
57
58impl OptimizedMirRelationExpr {
59 pub fn declare_optimized(expr: MirRelationExpr) -> OptimizedMirRelationExpr {
64 OptimizedMirRelationExpr(expr)
65 }
66
67 pub fn as_inner(&self) -> &MirRelationExpr {
72 &self.0
73 }
74
75 pub fn as_inner_mut(&mut self) -> &mut MirRelationExpr {
80 &mut self.0
81 }
82
83 pub fn into_inner(self) -> MirRelationExpr {
84 self.0
85 }
86}
87
88impl Deref for OptimizedMirRelationExpr {
89 type Target = MirRelationExpr;
90
91 fn deref(&self) -> &Self::Target {
92 &self.0
93 }
94}
95
96impl CollectionPlan for OptimizedMirRelationExpr {
97 fn depends_on_into(&self, out: &mut BTreeSet<GlobalId>) {
98 self.0.depends_on_into(out)
99 }
100}