Repository navigation
Conversation
# Conflicts: # .github/workflows/java.yml
# Conflicts: # docs/setup/sql-geometry-serialization.md
# Conflicts: # .github/workflows/python.yml
This branch has not been deployed
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?
Yes.
Is this PR related to a ticket?
Closes #3124.
What changes were proposed in this PR?
Use Spark 4.2's native
GEOMETRYandGEOGRAPHYtypes with Spark's shipped spatial serializer. Sedona retains JTS geometry computation and its newer S2 geography implementation. Native boundary validation remains active, including nested calls and computed join keys. The five overlapping Spark ST functions remain registered to Spark.The SQL/DataFrame boundary is separate from RDD and spatial-index serialization. Older Spark versions and explicit Sedona UDT schemas use the all-version public EWKB migration in #3528; RDD/Kryo, spatial-index, Python RDD and Flink formats remain unchanged. Direct and computed spatial join keys avoid the redundant Sedona SQL serialization/decode cycle. Spark's own encoding and validation are retained where required.
Native adapters cover file I/O, aggregate/container values, Python Classic/Connect, Arrow/UDF values and Sedona-owned GeoPandas boundaries. GeoParquet requires fixed per-column CRS on writes and rejects incompatible inferred CRS metadata; explicit ANY reads can preserve supported per-file SRIDs. Geography defaults distinguish omitted CRS from explicit invalid SRIDs. The migration guide documents the changed JVM/Python value contracts and file-I/O rules.
Review prerequisites
Independent fixes and preparation are separated for review:
The cumulative branch includes these prerequisites. They should land before the native integration; no PR has been merged by this work.
Performance scope
The isolated SQL serializer microbenchmarks are documented in #3528, including the approximately 8x point and 28x polygon encode slowdown of public JTS EWKB versus the previous compact representation. The all-version migration is intentional. Those measurements concern that SQL serializer change and are not end-to-end native Spark 4.2 query benchmarks. This PR does not install a substitute for Spark's serializer. Join tests verify the removed legacy round trip and required native validation; no unmeasured native speedup is claimed.
How was this patch tested?
Local validation of the integrated source tree (
23ff9cf5e6dca41585531e9731a11c3bb33797fd; the history-preserving merge leaves the tested tree unchanged):pyspark-client4.1.1 and 4.2.0 environments, without a JVM.mvn -B -pl spark/spark-4.2 -Dspark=4.2 -Dscala=2.13 verifydiscovers the full native module. Focused shared suites and clean shaded-artifact builds were run separately for each supported profile. The final Python pass usespytest tests/sql/test_native_spatial.py tests/geopandas/test_native_spatial.pyfor Classic andSPARK_REMOTE=local pytest tests/sql/test_native_spatial.pyfor Connect. Spotless, Scalastyle, repository hooks andgit diff --checkpassed. Full remote CI for this replacement head is pending.Runtime checks verify that the public Spark Geometry, Geography, WkbReader and WkbWriter class bytes are loaded unchanged. Exact commands and raw evidence are kept outside the repository.
Did this PR include necessary documentation updates?
The spatial type/serialization guide and Python/Scala installation pages document migration and verified upstream limitations. Native cache/persist and direct spatial grouping remain unsupported; raw pandas-on-Spark and native toPandas also have upstream conversion limitations. Sedona-owned adapters do not globally modify Spark's APIs. Spark 4.2 managed-runtime compatibility is not established by local OSS validation.
The native CI lane compiles the full reactor, runs applicable shared Java tests and selected shared spatial contract suites, discovers every native version-module suite, and exercises native Python Classic and Connect boundaries. Older runtime matrices retain their existing full coverage. Hadoop's MiniDFS WebHDFS fixture is excluded only on 4.2 because Hadoop's Jersey 2/javax server conflicts with Spark's Jersey 3/jakarta classes; older-runtime MiniDFS tests and native shapefile I/O remain covered. This is not a claim that every historical shared test or arbitrary pandas-on-Spark operation supports native spatial types.