jiayuasu opened a new pull request, #2980:
URL: https://github.com/apache/sedona/pull/2980

   ## Summary
   
   Closes #2809. Adds an `RS_DWithin(left, right, distance)` predicate so 
distance joins can use raster operands, and routes the join planner through the 
same spatial-index machinery used for `RS_Intersects` / `ST_DWithin`.
   
   - New `RS_DWithin` SQL function with three overloads (`raster + geom`, `geom 
+ raster`, `raster + raster`), backed by `RasterPredicates.rsDWithin` (CRS 
conversion via the existing `convertCRSIfNeeded`, JTS `isWithinDistance` for 
the predicate itself).
   - `JoinQueryDetector` and `OptimizableJoinCondition` treat `RS_DWithin` as a 
distance-join predicate. Broadcast plans go through `BroadcastIndexJoinExec`; 
non-broadcast plans go through `DistanceJoinExec`.
   - `BroadcastIndexJoinExec.createStreamShapes`, `SpatialIndexExec`, and 
`DistanceJoinExec` now project raster shapes to WGS84 envelopes (the same path 
`RS_Intersects` already uses) and expand by the radius before the R-tree 
filter. The new helper lives in `TraitJoinQueryBase.toExpandedWGS84EnvelopeRDD`.
   - Drops the placeholder `UnsupportedOperationException` for distance + 
raster combinations. Geography + raster + distance remains guarded since the 
geography refiner doesn't accept raster shapes yet.
   
   ## Test plan
   
   - [x] `BroadcastIndexJoinSuite`: new `Passed RS_DWithin` test exercises 
stream-raster, broadcast-raster, and swapped-operand forms.
   - [x] `RasterJoinSuite`: new `RS_DWithin distance join` describe block 
covers `DistanceJoinExec` with both partition-side configs, swapped operands, 
and raster-raster.
   - [x] All 122 tests across the two suites pass locally under `-Dspark=3.4 
-Pscala2.12`.
   
   ## Docs
   
   - New `docs/api/sql/Raster-Predicates/RS_DWithin.md` (intro, CRS rules, all 
three signatures, SQL example, join-planning note).
   - `Raster-Functions.md`: predicate table row for `RS_DWithin`.
   - `Optimizer.md`: new "Raster distance join" subsection with broadcast and 
non-broadcast SQL examples.


-- 
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]

Reply via email to