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::REPEAT_ROW_NAME;
37pub use relation::func::order_aggregate_datums as order_aggregate_datums_exported_for_benchmarking;
38pub use relation::func::{
39 AggregateFunc, AnalyzedRegex, AnalyzedRegexOpts, CaptureGroupDesc, LagLeadType,
40 NaiveOneByOneAggr, OneByOneAggr, TableFunc,
41};
42pub use relation::join_input_mapper::JoinInputMapper;
43pub use relation::{
44 AccessStrategy, AggregateExpr, CollectionPlan, ColumnOrder, JoinImplementation,
45 JoinInputCharacteristics, LetRecLimit, MirRelationExpr, RECURSION_LIMIT, RowComparator,
46 RowSetFinishing, RowSetFinishingIncremental, WindowFrame, WindowFrameBound, WindowFrameUnits,
47 canonicalize, compare_columns, non_nullable_columns,
48};
49pub use scalar::func::{self, BinaryFunc, UnaryFunc, UnmaterializableFunc, VariadicFunc};
50pub use scalar::{
51 Columns, Eval, EvalError, FilterCharacteristics, MirScalarExpr, OptimizableExpr,
52 ProtoDomainLimit, ProtoEvalError, like_pattern,
53};
54
55#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
58pub struct OptimizedMirRelationExpr(pub MirRelationExpr);
59
60impl OptimizedMirRelationExpr {
61 pub fn declare_optimized(expr: MirRelationExpr) -> OptimizedMirRelationExpr {
66 OptimizedMirRelationExpr(expr)
67 }
68
69 pub fn as_inner(&self) -> &MirRelationExpr {
74 &self.0
75 }
76
77 pub fn as_inner_mut(&mut self) -> &mut MirRelationExpr {
82 &mut self.0
83 }
84
85 pub fn into_inner(self) -> MirRelationExpr {
86 self.0
87 }
88}
89
90impl Deref for OptimizedMirRelationExpr {
91 type Target = MirRelationExpr;
92
93 fn deref(&self) -> &Self::Target {
94 &self.0
95 }
96}
97
98impl CollectionPlan for OptimizedMirRelationExpr {
99 fn depends_on_into(&self, out: &mut BTreeSet<GlobalId>) {
100 self.0.depends_on_into(out)
101 }
102}