pub struct DistancePredicate {
pub left: Arc<dyn PhysicalExpr>,
pub right: Arc<dyn PhysicalExpr>,
pub distance: Arc<dyn PhysicalExpr>,
pub distance_side: JoinSide,
}Expand description
Distance-based spatial join predicate.
This predicate represents a spatial join condition based on distance between geometries. It is used to find pairs of geometries from left and right tables where the distance between them is less than a specified threshold.
§Example SQL
SELECT * FROM left_table l JOIN right_table r
ON ST_Distance(l.geom, r.geom) < 100.0§Fields
left- Expression to evaluate the left side geometryright- Expression to evaluate the right side geometrydistance- Expression to evaluate the distance thresholddistance_side- Which side the distance expression belongs to (for column references)
Fields§
§left: Arc<dyn PhysicalExpr>The expression for evaluating the geometry value on the left side. The expression should be evaluated directly on the left side batches.
right: Arc<dyn PhysicalExpr>The expression for evaluating the geometry value on the right side. The expression should be evaluated directly on the right side batches.
distance: Arc<dyn PhysicalExpr>The expression for evaluating the distance value. The expression should be evaluated directly on the left or right side batches according to distance_side.
distance_side: JoinSideThe side of the distance expression. It could be JoinSide::None if the distance expression is not a column reference. The most common case is that the distance expression is a literal value.
Implementations§
Source§impl DistancePredicate
impl DistancePredicate
Sourcepub fn new(
left: Arc<dyn PhysicalExpr>,
right: Arc<dyn PhysicalExpr>,
distance: Arc<dyn PhysicalExpr>,
distance_side: JoinSide,
) -> Self
pub fn new( left: Arc<dyn PhysicalExpr>, right: Arc<dyn PhysicalExpr>, distance: Arc<dyn PhysicalExpr>, distance_side: JoinSide, ) -> Self
Creates a new distance predicate.
§Arguments
left- Expression for the left side geometryright- Expression for the right side geometrydistance- Expression for the distance thresholddistance_side- Which side (Left, Right, or None) the distance expression belongs to
Trait Implementations§
Source§impl Clone for DistancePredicate
impl Clone for DistancePredicate
Source§fn clone(&self) -> DistancePredicate
fn clone(&self) -> DistancePredicate
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DistancePredicate
impl Debug for DistancePredicate
Source§impl Display for DistancePredicate
impl Display for DistancePredicate
Source§impl SpatialPredicateTrait for DistancePredicate
impl SpatialPredicateTrait for DistancePredicate
Source§fn swap_for_swapped_children(&self) -> Self
fn swap_for_swapped_children(&self) -> Self
Source§fn update_for_child_projections(
&self,
projected_left_exprs: &[ProjectionExpr],
projected_right_exprs: &[ProjectionExpr],
) -> Result<Option<Self>>
fn update_for_child_projections( &self, projected_left_exprs: &[ProjectionExpr], projected_right_exprs: &[ProjectionExpr], ) -> Result<Option<Self>>
Auto Trait Implementations§
impl Freeze for DistancePredicate
impl !RefUnwindSafe for DistancePredicate
impl Send for DistancePredicate
impl Sync for DistancePredicate
impl Unpin for DistancePredicate
impl UnsafeUnpin for DistancePredicate
impl !UnwindSafe for DistancePredicate
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