pub struct PredicateRewriter { /* private fields */ }Expand description
Rewrite a predicate expression in terms of statistics (min/max/null_counts)
for use as a PruningPredicate.
Implementations§
Source§impl PredicateRewriter
impl PredicateRewriter
Sourcepub fn with_unhandled_hook(
self,
unhandled_hook: Arc<dyn UnhandledPredicateHook>,
) -> Self
pub fn with_unhandled_hook( self, unhandled_hook: Arc<dyn UnhandledPredicateHook>, ) -> Self
Set the unhandled hook to be used when a predicate can not be rewritten
Sourcepub fn with_max_in_list_size(self, max_in_list_size: usize) -> Self
pub fn with_max_in_list_size(self, max_in_list_size: usize) -> Self
Set the maximum size of an IN (...) list that will be rewritten into a
chain of per-value statistics checks. Lists longer than this fall back
to the unhandled-predicate hook (typically “keep the container”),
effectively skipping container-level pruning for large IN lists.
The default (see MAX_IN_LIST_SIZE) preserves the
historical behaviour. Callers wiring config through can override via
datafusion.execution.max_in_list_size.
Sourcepub fn rewrite_predicate_to_statistics_predicate(
&self,
expr: &Arc<dyn PhysicalExpr>,
schema: &Schema,
) -> Arc<dyn PhysicalExpr> ⓘ
pub fn rewrite_predicate_to_statistics_predicate( &self, expr: &Arc<dyn PhysicalExpr>, schema: &Schema, ) -> Arc<dyn PhysicalExpr> ⓘ
Translate logical filter expression into pruning predicate expression that will evaluate to FALSE if it can be determined no rows between the min/max values could pass the predicates.
Any predicates that can not be translated will be passed to unhandled_hook.
Returns the pruning predicate as an PhysicalExpr
Notice: IN (...) lists longer than max_in_list_size (default
MAX_IN_LIST_SIZE) fall back to calling unhandled_hook.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PredicateRewriter
impl !Send for PredicateRewriter
impl !Sync for PredicateRewriter
impl !UnwindSafe for PredicateRewriter
impl Freeze for PredicateRewriter
impl Unpin for PredicateRewriter
impl UnsafeUnpin for PredicateRewriter
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> 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