#![warn(missing_debug_implementations)]
use std::collections::BTreeSet;
use std::ops::Deref;
use mz_repr::GlobalId;
use proptest_derive::Arbitrary;
use serde::{Deserialize, Serialize};
mod id;
mod interpret;
mod linear;
mod relation;
mod scalar;
pub mod explain;
pub mod row;
pub mod virtual_syntax;
pub mod visit;
pub use id::{Id, LocalId, ProtoId, ProtoLocalId, SourceInstanceId};
pub use interpret::{ColumnSpec, ColumnSpecs, Interpreter, ResultSpec, Trace, TraceSummary};
pub use linear::plan::{MfpPlan, SafeMfpPlan};
pub use linear::util::{join_permutations, permutation_for_arrangement};
pub use linear::{
memoize_expr, MapFilterProject, ProtoMapFilterProject, ProtoMfpPlan, ProtoSafeMfpPlan,
};
pub use relation::func::order_aggregate_datums as order_aggregate_datums_exported_for_benchmarking;
pub use relation::func::{
AggregateFunc, AnalyzedRegex, CaptureGroupDesc, LagLeadType, NaiveOneByOneAggr, OneByOneAggr,
TableFunc,
};
pub use relation::join_input_mapper::JoinInputMapper;
pub use relation::{
canonicalize, compare_columns, non_nullable_columns, AccessStrategy, AggregateExpr,
CollectionPlan, ColumnOrder, JoinImplementation, JoinInputCharacteristics, LetRecLimit,
MirRelationExpr, ProtoAggregateExpr, ProtoAggregateFunc, ProtoColumnOrder,
ProtoRowSetFinishing, ProtoTableFunc, RowSetFinishing, WindowFrame, WindowFrameBound,
WindowFrameUnits, RECURSION_LIMIT,
};
pub use scalar::func::{self, BinaryFunc, UnaryFunc, UnmaterializableFunc, VariadicFunc};
pub use scalar::{
like_pattern, EvalError, FilterCharacteristics, MirScalarExpr, ProtoDomainLimit,
ProtoEvalError, ProtoMirScalarExpr,
};
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize, Arbitrary)]
pub struct OptimizedMirRelationExpr(pub MirRelationExpr);
impl OptimizedMirRelationExpr {
pub fn declare_optimized(expr: MirRelationExpr) -> OptimizedMirRelationExpr {
OptimizedMirRelationExpr(expr)
}
pub fn as_inner(&self) -> &MirRelationExpr {
&self.0
}
pub fn as_inner_mut(&mut self) -> &mut MirRelationExpr {
&mut self.0
}
pub fn into_inner(self) -> MirRelationExpr {
self.0
}
}
impl Deref for OptimizedMirRelationExpr {
type Target = MirRelationExpr;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl CollectionPlan for OptimizedMirRelationExpr {
fn depends_on_into(&self, out: &mut BTreeSet<GlobalId>) {
self.0.depends_on_into(out)
}
}