SpatialFilter

Enum SpatialFilter 

Source
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

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> SpatialFilter

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SpatialFilter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> ErasedDestructor for T
where T: 'static,