Skip to content

API: Treat EPSG:4326 and OGC:CRS84 as equivalent CRS identifiers - #18685

Open
ump45nose wants to merge 2 commits into
apache:mainfrom
ump45nose:fix/18680-crs84-epsg4326-equivalence
Open

ump45nose wants to merge 2 commits into
apache:mainfrom
ump45nose:fix/18680-crs84-epsg4326-equivalence

Conversation

@ump45nose

Copy link
Copy Markdown
Contributor

What changes?

GeometryType / GeographyType equality treated CRS identifiers as equal only with a case-insensitive string match. After #17578, Parquet files written through arrow-rs / Arrow C++ (and therefore iceberg-rust) carry the WGS84 lon/lat default as OGC:CRS84, while Iceberg tables are often declared as EPSG:4326. Validation then rejected those files even though both names refer to the same lon/lat WGS84 reference.

This change adds Types.crsEquivalent / crsHashKey so the OGC:CRS84 ↔ EPSG:4326 pair is interchangeable for equals and hashCode (still case-insensitive). Other schemes such as srid:4326 stay distinct. crs() / toString() still return the original identifier.

Closes #18680.

Test plan

  • ./gradlew :iceberg-api:test --tests org.apache.iceberg.types.TestTypes
  • ./gradlew :iceberg-api:checkstyleMain :iceberg-api:checkstyleTest spotlessCheck

AI Disclosure

Parquet writers (arrow-rs / Arrow C++) emit the WGS84 lon/lat default as
OGC:CRS84. Iceberg tables commonly declare Geometry/Geography as
EPSG:4326. After Parquet CRS validation (apache#17578), those files fail
equality checks even though both identifiers refer to the same lon/lat
WGS84 reference.

Add Types.crsEquivalent / crsHashKey so GeometryType and GeographyType
equals and hashCode treat the pair as interchangeable (case-insensitive),
while leaving other schemes such as srid:4326 distinct. Closes apache#18680.

Generated-by: Cursor
Signed-off-by: Vincent <1729065730@qq.com>
@github-actions github-actions Bot added the API label Oct 29, 2026
EPSG:4326 and OGC:CRS84 are now equivalent, so the mismatch case uses
EPSG:4269. Also cover pruning a file whose CRS is the equivalent
identifier of the projected type.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parquet files written with the "default" CRS are not compatible with Iceberg Java EPSG:4326 table

1 participant