pub enum SpatialFilter {
Intersects(Column, BoundingBox),
Covers(Column, BoundingBox),
HasZ(Column),
And(Box<SpatialFilter>, Box<SpatialFilter>),
Or(Box<SpatialFilter>, Box<SpatialFilter>),
LiteralFalse,
Unknown,
}Expand description
Simplified parsed spatial filter
This enumerator represents a parsed version of the PhysicalExpr provided as a filter to an implementation of a table provider or file opener. This is intended as a means by which to process an arbitrary PhysicalExpr against column statistics to attempt pruning unnecessary files or parts of files specifically with respect to a spatial filter (i.e., non-spatial filters we leave to an underlying implementation).
Variants§
Intersects(Column, BoundingBox)
ST_Intersects(<column>, <literal>) or ST_Intersects(<literal>, <column>)
Covers(Column, BoundingBox)
ST_Covers(<column>, <literal>) or ST_Covers(<literal>, <column>)
HasZ(Column)
ST_HasZ(<column>)
And(Box<SpatialFilter>, Box<SpatialFilter>)
Logical AND
Or(Box<SpatialFilter>, Box<SpatialFilter>)
Logical OR
LiteralFalse
A literal FALSE, which is never true
Unknown
An expression we don’t know about, which we assume could be true
Implementations§
Source§impl SpatialFilter
impl SpatialFilter
Sourcepub fn filter_bbox(&self, column_name: &str) -> BoundingBox
pub fn filter_bbox(&self, column_name: &str) -> BoundingBox
Compute the maximum extent of a filter for a specific column index
Some spatial file formats have the ability to push down a bounding box into an index. This function allows deriving that bounding box based on what DataFusion provides, which is a physical expression.
Note that this always succeeds; however, for a non-spatial expression or a non-spatial expression that is unsupported, the full bounding box is returned.
Sourcepub fn evaluate(&self, table_stats: &TableGeoStatistics) -> Result<bool>
pub fn evaluate(&self, table_stats: &TableGeoStatistics) -> Result<bool>
Returns true if there is any chance the expression might be true
In other words, returns false if and only if the expression is guaranteed to be false.
Sourcepub fn try_from_expr(expr: &Arc<dyn PhysicalExpr>) -> Result<Self>
pub fn try_from_expr(expr: &Arc<dyn PhysicalExpr>) -> Result<Self>
Construct a SpatialPredicate from a PhysicalExpr
Parses expr to extract known expressions we can evaluate against statistics.
Trait Implementations§
Source§impl Clone for SpatialFilter
impl Clone for SpatialFilter
Source§fn clone(&self) -> SpatialFilter
fn clone(&self) -> SpatialFilter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SpatialFilter
impl RefUnwindSafe for SpatialFilter
impl Send for SpatialFilter
impl Sync for SpatialFilter
impl Unpin for SpatialFilter
impl UnwindSafe for SpatialFilter
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