Struct datafusion_optimizer::analyzer::Analyzer
source · pub struct Analyzer {
pub function_rewrites: Vec<Arc<dyn FunctionRewrite + Send + Sync>>,
pub rules: Vec<Arc<dyn AnalyzerRule + Send + Sync>>,
}
Expand description
A rule-based Analyzer.
An Analyzer
transforms a LogicalPlan
prior to the rest of the DataFusion optimization process.
Fields§
§function_rewrites: Vec<Arc<dyn FunctionRewrite + Send + Sync>>
Expr –> Function writes to apply prior to analysis passes
rules: Vec<Arc<dyn AnalyzerRule + Send + Sync>>
All rules to apply
Implementations§
source§impl Analyzer
impl Analyzer
sourcepub fn with_rules(rules: Vec<Arc<dyn AnalyzerRule + Send + Sync>>) -> Self
pub fn with_rules(rules: Vec<Arc<dyn AnalyzerRule + Send + Sync>>) -> Self
Create a new analyzer with the given rules
sourcepub fn add_function_rewrite(
&mut self,
rewrite: Arc<dyn FunctionRewrite + Send + Sync>,
)
pub fn add_function_rewrite( &mut self, rewrite: Arc<dyn FunctionRewrite + Send + Sync>, )
Add a function rewrite rule
sourcepub fn function_rewrites(&self) -> &[Arc<dyn FunctionRewrite + Send + Sync>]
pub fn function_rewrites(&self) -> &[Arc<dyn FunctionRewrite + Send + Sync>]
return the list of function rewrites in this analyzer
sourcepub fn execute_and_check<F>(
&self,
plan: LogicalPlan,
config: &ConfigOptions,
observer: F,
) -> Result<LogicalPlan>
pub fn execute_and_check<F>( &self, plan: LogicalPlan, config: &ConfigOptions, observer: F, ) -> Result<LogicalPlan>
Analyze the logical plan by applying analyzer rules, and do necessary check and fail the invalid plans
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Analyzer
impl !RefUnwindSafe for Analyzer
impl Send for Analyzer
impl Sync for Analyzer
impl Unpin for Analyzer
impl !UnwindSafe for Analyzer
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more