huan233usc opened a new pull request, #16766:
URL: https://github.com/apache/iceberg/pull/16766

   ## Summary
   
   Normalize the default edge-interpolation algorithm in `Types.GeographyType` 
the same way the default CRS is already normalized, so that semantically 
identical geography types compare equal.
   
   `GeographyType`'s constructor already collapses the default CRS 
(`OGC:CRS84`) to an internal `null`, but it kept an explicit `SPHERICAL` 
algorithm as-is. As a result `GeographyType.of(crs, EdgeAlgorithm.SPHERICAL)` 
was **not** `equals()` to the equivalent `GeographyType.of(crs)` (internal 
`algorithm == null`), even though `SPHERICAL` is the documented default and the 
`algorithm()` getter materializes `SPHERICAL` for both. This also meant a plain 
`geography` type did not round-trip through format conversions that omit 
default values — e.g. Parquet's geography logical type, where an unset 
`algorithm` defaults to `SPHERICAL` (#16765).
   
   This change collapses an explicit default `SPHERICAL` to the same internal 
`null` in the constructor, matching the existing CRS normalization on the line 
directly above it. The `algorithm()` getter still returns `SPHERICAL` by 
default and non-default algorithms are untouched, so `equals()` / `hashCode()` 
/ `toString()` now treat `geography(crs, spherical)` and `geography(crs)` as 
the same type. No public signature changes.
   
   ## Test plan
   
   - [x] Extended `testGeospatialTypeToString` to confirm an explicit default 
`SPHERICAL` renders the same as an omitted algorithm (`geography`, 
`geography(srid:4326)`).
   - [x] New `testGeospatialTypeDefaultNormalization` covers `equals()` / 
`hashCode()` parity for the default-CRS and default-algorithm forms, that 
`algorithm()` still reports `SPHERICAL`, and that a non-default algorithm 
(`KARNEY`) stays distinct.
   - [x] `./gradlew :iceberg-api:check` — clean (tests, checkstyle, revapi, 
spotless).
   - [x] `./gradlew :iceberg-core:test` — full core suite green, no regressions 
in `TestSchemaParser` / `TestSingleValueParser` / `TestGeospatialTable` or 
anywhere geography types are serialized.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to