petern48 commented on code in PR #2447:
URL: https://github.com/apache/sedona/pull/2447#discussion_r2462610817
##########
spark/common/src/test/scala/org/apache/sedona/sql/SpatialJoinSuite.scala:
##########
@@ -268,6 +268,15 @@ class SpatialJoinSuite extends TestBaseScala with
TableDrivenPropertyChecks {
assert(resultRows.isEmpty)
}
}
+
+ it("ST_Distance join involving empty geometries should evaluate to false")
{
+ val result1 = sparkSession.sql(
Review Comment:
Hmm, that's a good point. I now see that the difference in optimizer rules
could make an actual spatial join different than this test. I'm not sure why it
was working in the past. Without digging through the code, I would guess maybe
there might be a rule somewhere that swaps this out for a ST_DWithin join?
Looking at [the dwithin
implementation](https://github.com/apache/sedona/blob/1eb5769be3b1ab7266a9dcecc6e3407ba28ab57a/common/src/main/java/org/apache/sedona/common/Predicates.java#L70-L82),
it uses JTS's distance() and not the Functions.distance() that I modified
here. If this is the case, it is possible the distance join is buggy.
Regardless, I think for now I'd rather wrap up this PR and potentially look
into this later. I filed this issue to check if we're getting the same results
as geopandas (which I know is not quite postgis, but it's a good easy starting
point) https://github.com/apache/sedona/issues/2450
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]