Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ case class BroadcastIndexJoinExec(
case (None, _, false) => s"ST_$spatialPredicate($windowExpression, $objectExpression)"
case (None, _, true) => s"RS_$spatialPredicate($windowExpression, $objectExpression)"
case (Some(r), _, true) =>
s"RS_Distance($windowExpression, $objectExpression) < $r"
s"RS_DWithin($windowExpression, $objectExpression, $r)"
}

override def simpleString(maxFields: Int): String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@ trait TraitJoinQueryBase {
private[join] def expandRasterFilterEnvelope(
baseShape: Geometry,
distance: Double): Geometry = {
// An empty shape (e.g. the empty GeometryCollection substituted for a NULL raster/geometry)
// must stay empty: expanding its degenerate envelope by `distance` would yield a non-empty
// filter geometry that spuriously matches rows the predicate should never join.
if (baseShape.isEmpty) {
return baseShape
}
Comment thread
jiayuasu marked this conversation as resolved.
val envelope = baseShape.getEnvelopeInternal
val touchesPole = envelope.getMaxY >= 90.0 || envelope.getMinY <= -90.0
val tooWide = envelope.getWidth > 180.0
Expand Down
Loading