sedona icon indicating copy to clipboard operation
sedona copied to clipboard

Support spatialJoin when the join clause contains unequal conditions

Open chinagui opened this issue 2 years ago • 2 comments

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

chinagui avatar Jun 09 '23 07:06 chinagui

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

Kontinuation avatar Jun 10 '23 13:06 Kontinuation

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

chinagui avatar Jun 26 '23 03:06 chinagui