pub trait OptimizableExpr:
Columns
+ VisitChildren<Self>
+ Clone
+ Eq
+ Ord
+ Hash
+ Debug
+ Sized
+ Serialize {
// Required methods
fn is_literal(&self) -> bool;
fn is_literal_err(&self) -> bool;
fn contains_temporal(&self) -> bool;
fn size(&self) -> usize;
fn eager_children(&mut self) -> Option<Vec<&mut Self>>;
fn equality_column_alias(
predicate: &Self,
expr: &Self,
threshold: usize,
) -> Option<Self>;
fn extract_temporal_bounds(
temporal: Vec<Self>,
) -> Result<(Vec<Self>, Vec<Self>), String>;
// Provided method
fn visit_pre<F>(&self, f: &mut F) -> Result<(), RecursionLimitError>
where F: FnMut(&Self) { ... }
}Expand description
A scalar expression type that can be optimized inside a MapFilterProject.
Implemented by MirScalarExpr and LirScalarExpr.
Required Methods§
Sourcefn is_literal(&self) -> bool
fn is_literal(&self) -> bool
True if this expression is a literal.
Sourcefn is_literal_err(&self) -> bool
fn is_literal_err(&self) -> bool
True if this expression is a literal error.
Sourcefn contains_temporal(&self) -> bool
fn contains_temporal(&self) -> bool
True if this expression contains a temporal reference (mz_now()).
Sourcefn eager_children(&mut self) -> Option<Vec<&mut Self>>
fn eager_children(&mut self) -> Option<Vec<&mut Self>>
For memoization: which children should be eagerly memoized?
Returns None to visit all children (the common case).
Returns Some(children) for selective descent — e.g., for If, only the
condition should be eagerly memoized (branches may not be taken).
Sourcefn equality_column_alias(
predicate: &Self,
expr: &Self,
threshold: usize,
) -> Option<Self>
fn equality_column_alias( predicate: &Self, expr: &Self, threshold: usize, ) -> Option<Self>
If predicate is col = expr (or expr = col) where col is a column
with index < threshold, return a clone of that column expression.
Used by optimize() to detect equality-derived column aliases.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".