pub struct Analyzer {
pub function_rewrites: Vec<Arc<dyn FunctionRewrite + Send + Sync>>,
pub rules: Vec<Arc<dyn AnalyzerRule + Send + Sync>>,
}Expand description
Rule-based Analyzer.
Applies FunctionRewrites and AnalyzerRules to transform a
LogicalPlan in preparation for execution.
For example, the Analyzer applies type coercion to ensure the types of
operands match the types required by functions.
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§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