sedona
sedona copied to clipboard
Support spatialJoin when the join clause contains unequal conditions
Expected behavior
Support spatialJoin when the join clause contains unequal conditions
Actual behavior
When there are spatial relationship conditions and non equivalence conditions in the join clause, spatialjoin is not effective and BroadcastNestedLoopJoin is used
Steps to reproduce the problem
Settings
Sedona version = 1.4.0
Apache Spark version = 3.3.0
Apache Flink version = ?
API type = Scala
Scala version = 2.12
JRE version = 1.8
Python version = ?
Environment = Standalone
Can you provide an example query to reproduce this problem? I've tried queries like this and it was planned as a RangeJoin.
SELECT * FROM df1 JOIN df2 ON ST_Contains(df1.geom, df2.geom) AND df1.dist > df2.dist
Like this,
SELECT a.*
FROM a
JOIN b ON st_contains(a.geometry, b.geometry)
JOIN c ON st_contains(b.geometry, c.geometry)
WHERE a.id !=b.id
AND b.id != c.id