pub struct SamkhyaOptimizerRule { /* private fields */ }Expand description
DataFusion adapter rule that bridges samkhya’s corrected statistics into the optimizer.
Implements both OptimizerRule (logical observe-only) and
PhysicalOptimizerRule (physical validator). The physical pass is
the visible integration point; the actual scan-wrapping that makes
physical.statistics()?.num_rows reflect samkhya’s corrections is
done by crate::SamkhyaTableProvider’s scan() at plan-construction
time.
Register with both
SessionStateBuilder::with_optimizer_rule and
SessionStateBuilder::with_physical_optimizer_rule.
Implementations§
Source§impl SamkhyaOptimizerRule
impl SamkhyaOptimizerRule
Sourcepub fn samkhya_leaves_seen(&self) -> usize
pub fn samkhya_leaves_seen(&self) -> usize
Number of SamkhyaStatsExec wrappers seen by the most recent
physical-optimize pass.
Useful in tests to confirm the physical pass actually observed
the wrappers installed by SamkhyaTableProvider::scan.
Trait Implementations§
Source§impl Clone for SamkhyaOptimizerRule
impl Clone for SamkhyaOptimizerRule
Source§impl Debug for SamkhyaOptimizerRule
impl Debug for SamkhyaOptimizerRule
Source§impl Default for SamkhyaOptimizerRule
impl Default for SamkhyaOptimizerRule
Source§fn default() -> SamkhyaOptimizerRule
fn default() -> SamkhyaOptimizerRule
Source§impl OptimizerRule for SamkhyaOptimizerRule
impl OptimizerRule for SamkhyaOptimizerRule
Source§fn apply_order(&self) -> Option<ApplyOrder>
fn apply_order(&self) -> Option<ApplyOrder>
ApplyOrder for details. Read moreSource§fn supports_rewrite(&self) -> bool
fn supports_rewrite(&self) -> bool
Source§fn rewrite(
&self,
plan: LogicalPlan,
_config: &dyn OptimizerConfig,
) -> Result<Transformed<LogicalPlan>>
fn rewrite( &self, plan: LogicalPlan, _config: &dyn OptimizerConfig, ) -> Result<Transformed<LogicalPlan>>
plan to an optimized form, returning Transformed::yes
if the plan was rewritten and Transformed::no if it was not. Read moreSource§fn try_optimize(
&self,
_plan: &LogicalPlan,
_config: &dyn OptimizerConfig,
) -> Result<Option<LogicalPlan>, DataFusionError>
fn try_optimize( &self, _plan: &LogicalPlan, _config: &dyn OptimizerConfig, ) -> Result<Option<LogicalPlan>, DataFusionError>
please implement supports_rewrite and rewrite instead
plan to an optimized form, returning None if the plan
cannot be optimized by this rule. Read moreSource§impl PhysicalOptimizerRule for SamkhyaOptimizerRule
impl PhysicalOptimizerRule for SamkhyaOptimizerRule
Source§fn schema_check(&self) -> bool
fn schema_check(&self) -> bool
Source§fn optimize(
&self,
plan: Arc<dyn ExecutionPlan>,
_config: &ConfigOptions,
) -> Result<Arc<dyn ExecutionPlan>>
fn optimize( &self, plan: Arc<dyn ExecutionPlan>, _config: &ConfigOptions, ) -> Result<Arc<dyn ExecutionPlan>>
plan to an optimized formAuto Trait Implementations§
impl !Freeze for SamkhyaOptimizerRule
impl RefUnwindSafe for SamkhyaOptimizerRule
impl Send for SamkhyaOptimizerRule
impl Sync for SamkhyaOptimizerRule
impl Unpin for SamkhyaOptimizerRule
impl UnsafeUnpin for SamkhyaOptimizerRule
impl UnwindSafe for SamkhyaOptimizerRule
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
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>
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>
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