[GH-2830] Adds Geography dual-dispatch to ST_Intersects#2856
Merged
jiayuasu merged 6 commits intoapache:masterfrom Apr 30, 2026
Merged
[GH-2830] Adds Geography dual-dispatch to ST_Intersects#2856jiayuasu merged 6 commits intoapache:masterfrom
jiayuasu merged 6 commits intoapache:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends Sedona’s ST_Intersects to support Geography inputs via dual-dispatch: Geometry inputs continue to use the existing JTS implementation, while Geography inputs use S2 boolean operations, and join planning remains geometry-only (geography falls back to row-by-row evaluation).
Changes:
- Convert
ST_IntersectsfromST_PredicatetoInferredExpressionwith Geometry/Geography dual-dispatch. - Update join detection so
ST_Intersectsis planned as a spatial join only for non-Geography inputs. - Add Geography unit/integration tests and introduce new SQL docs for Geography
ST_Intersects.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/Predicates.scala | Switch ST_Intersects to dual-dispatch (InferredExpression) for Geography support. |
| spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/JoinQueryDetector.scala | Preserve geometry join planning for ST_Intersects and guard against Geography inputs. |
| common/src/main/java/org/apache/sedona/common/geography/Functions.java | Add S2-based Functions.intersects(Geography, Geography). |
| common/src/test/java/org/apache/sedona/common/Geography/FunctionTest.java | Add Geography-level unit tests for Functions.intersects. |
| spark/common/src/test/scala/org/apache/sedona/sql/geography/GeographyFunctionTest.scala | Add Spark SQL integration tests for Geography ST_Intersects. |
| docs/api/sql/geography/Geography-Functions/ST_Intersects.md | Add Geography SQL API documentation page for ST_Intersects. |
| docs/api/sql/geography/Geography-Functions.md | Add ST_Intersects to the Geography functions index table. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jiayuasu
reviewed
Apr 29, 2026
…upport.st_intersects
jiayuasu
approved these changes
Apr 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Did you read the Contributor Guide?
Is this PR related to a ticket?
[GH-XXX] my subject. Closes #<issue_number>What changes were proposed in this PR?
How was this patch tested?
Did this PR include necessary documentation updates?