Conversation
This was referenced Sep 16, 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?
Yes.
Is this PR related to a ticket?
Prerequisite for #3374 and #3369. Uses the merged JTS copy fix in jiayuasu/jts#10.
What changes were proposed in this PR?
ST_SetSRIDcurrently removes empty members while copying a collection. For example, a collection containing an empty point and a populated point returns only the populated point after changing SRID. Empty polygon holes are also dropped. A standalone empty polygon can be returned as the original object, mutating its SRID rather than creating a copy.Use the isolated JTS
GeometryCopierwith the requested SRID and the input's coordinate-sequence factory. This preserves every component and ring, including empty holes, and creates independent coordinate storage. Copies discarduserData; the source geometry and its metadata remain unchanged. The copy logic is maintained in JTS, so this PR adds no Sedona geometry factory or serialization classes.The dependency is the unpublished
org.datasyslab:jts-io-patch:1.21.0-datasyslab-2candidate. It uses stock JTS 1.20 geometry types and does not require replacing Spark's bundled JTS jar. Publication is pending the related PR reviews.How was this patch tested?
The regressions fail against the base implementation and pass with the fix. They cover nested empty components, all three multipart types, empty polygon holes, empty-polygon input mutation, XYM/XYZ/XYZM layouts, packed sequences, geometry and factory SRIDs, independent copies, and source/userData preservation. A Spark SQL regression checks the empty-hole count before and after
ST_SetSRID.Full common suite on Java 11: 1,379 tests passed, zero failures/errors/skips. Validated against JTS candidate commit
f00cd7103ef4e27dc1bbe59bbcc20af7b49d3da7.Spark 3.5 and 4.1 each ran 287 selected Scala tests: 240 function tests and 46 constructor tests passed. The remaining MySQL constructor test could not start the local Docker environment and failed before Sedona assertions. The new SQL empty-hole regression passed on both profiles.
A stock PySpark 4.1.1
local[2]smoke test preserved empty polygon holes and all three empty collection members with SRID 4326. Geometry classes loaded from Spark's bundled JTS 1.20 jar; its SHA-256 was unchanged. All four isolated helper classes in the shaded jar match the tested local JTS candidate.Did this PR include necessary documentation updates?
No public SQL API or configuration was added. Changing SRID retains the input's geometry structure.