[GH-3182] GeoPandas: Implement distributed sjoin_nearest - #3184
Draft
jiayuasu wants to merge 8 commits into
Draft
Conversation
This was referenced Jul 27, 2026
jiayuasu
marked this pull request as draft
July 28, 2026 02:46
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 GeoPandas: implement distributed sjoin_nearest #3182What changes were proposed in this PR?
This PR implements distributed GeoPandas-compatible
sjoin_nearestfor the top-level API andGeoDataFrame.The implementation uses Sedona's distributed KNN join rather than a Cartesian product, Python geometry UDF, or driver-side geometry collection. It supports inner, left, and right joins; equidistant matches;
max_distance;distance_col;exclusive; suffixing; named and MultiIndex inputs; null/empty geometries; active geometry; CRS; and SRID preservation.The SQL KNN predicate gains five- and six-argument forms for query-local
include_tiesandexclusivecontrols. The regular planar path now routes non-point queries by their full geometry and reconciles partition-local candidates with bounded per-query state and stable row identities. Legacy three/four-argument and geography tie behavior remain unchanged.Candidate selection without ties is deterministic across regular and both broadcast plans.
max_distanceis currently an output post-filter and does not prune the distributed KNN search.English and Chinese SQL and GeoPandas documentation are updated.
How was this patch tested?
KnnJoinSuite(41 tests)ST_KNNplan/API/type testsThe tests force regular and both broadcast KNN plans and cover non-point queries, duplicate rows, ties, exclusive ranking, outer reconstruction, indexes, column collisions, null/empty geometries, CRS/SRID metadata, and legacy/geography compatibility.
Did this PR include necessary documentation updates?
v1.9.1.