Skip to content

[GH-3260] Add ST_EqualsIdentical across Sedona SQL engines - #3266

Merged
jiayuasu merged 3 commits into
apache:masterfrom
jiayuasu:feature/st-equals-identical
Aug 18, 2026
Merged

[GH-3260] Add ST_EqualsIdentical across Sedona SQL engines#3266
jiayuasu merged 3 commits into
apache:masterfrom
jiayuasu:feature/st-equals-identical

Conversation

@jiayuasu

@jiayuasu jiayuasu commented Aug 15, 2026

Copy link
Copy Markdown
Member

Did you read the Contributor Guide?

Is this PR related to a ticket?

  • Yes, and the PR name follows the format [GH-XXX] my subject.

Part of #3260.

The serialization prerequisites #3265 and #3268 have merged into master.

What changes were proposed in this PR?

  • Add a common ST_EqualsIdentical implementation that compares exact geometry type, nested structure, component and coordinate order, dimensionality, and every XY/Z/M ordinate.
  • Treat corresponding NaN ordinates as equal, treat positive and negative zero as equal, and ignore SRID and other geometry metadata.
  • Register and expose the predicate through:
    • Spark SQL, DataFrame APIs, Spark Connect, and the Python Spark SQL API
    • Flink SQL
    • Snowflake WKB and native GEOMETRY UDF paths
  • Add SQL documentation for Spark, Flink, and Snowflake, including each engine's stored-geometry dimensionality boundary and practical round-trip validation examples.

This is the second PR in the #3260 stack and is now based directly on master. Its two serialization prerequisites are merged:

ST_EqualsIdentical compares the geometry representation it receives; it cannot reconstruct dimensional information already discarded by an upstream representation. JTS 1.20's default coordinate-sequence factory still makes ordinary XY indistinguishable from declared XYZ whose Z ordinates are all NaN, while Snowflake native GEOMETRY stores normalized 2D coordinates. The engine-specific documentation calls out these boundaries.

The final stacked PR is #3262, which adds distributed GeoPandas geom_equals_identical on top of this predicate.

How was this patch tested?

  • Full common test suite: 1,304 tests passed.
  • Spark predicate suite: 37 tests passed.
  • Spark DataFrame API suite: 261 tests passed.
  • Flink predicate suite: 24 tests passed.
  • Snowflake DDL suite: 3 tests passed; both modified Snowflake tester suites compiled successfully.
  • Regression coverage includes XY/Z/M/ZM distinctions, NaN and infinity handling, represented typed empties, component and ring ordering, SRID independence, null propagation, API argument validation, and SerDe-preserved dimensional layouts.
  • The repository commit-hook suite, Spotless, documentation build, Markdown linting, and git diff --check passed.

Did this PR include necessary documentation updates?

  • Yes, I am adding a new API. I am using the current SNAPSHOT version, v2.0.0.
  • Yes, I added Spark, Flink, and Snowflake SQL documentation.

@jiayuasu
jiayuasu force-pushed the feature/st-equals-identical branch from 25adddc to 225fe87 Compare August 18, 2026 03:49
@jiayuasu
jiayuasu marked this pull request as ready for review August 18, 2026 04:59
@jiayuasu jiayuasu linked an issue Aug 18, 2026 that may be closed by this pull request
@jiayuasu jiayuasu added this to the sedona-2.0.0 milestone Aug 18, 2026
@jiayuasu
jiayuasu merged commit 88a9720 into apache:master Aug 18, 2026
44 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GeoPandas: implement distributed geom_equals_identical

1 participant