huan233usc opened a new pull request, #17509: URL: https://github.com/apache/iceberg/pull/17509
## Summary Geometry bounding-box metrics need to inspect WKB coordinates without adding a geometry-library dependency to `iceberg-api`. This adds a pure-Java scanner that folds a WKB value into a two-dimensional XY accumulator while leaving the caller's `ByteBuffer` position and limit unchanged. - Walk all OGC WKB geometry types, including nested collections and mixed-endian children - Read past Z and M ordinates while accumulating only XY bounds - Skip NaN independently per coordinate dimension and retain infinities as bound values - Reject malformed byte order, geometry type, counts, truncation, and excessive nesting with `IllegalArgumentException` This PR only adds the reusable WKB scanner. Geometry field metrics and Parquet/Spark writer integration remain in follow-up PRs. ## Test Plan - [x] Covered every geometry type, XY/Z/M/ZM layouts, byte orders, nested and empty collections, degenerate polygons, per-axis NaN handling, infinities, malformed inputs, and nesting limits - [x] Ran the targeted API test class - [x] Ran API formatting checks - [x] Ran API compatibility checks ## Verification Commands ```bash ./gradlew :iceberg-api:test --tests org.apache.iceberg.geospatial.TestWKBBoundingBox ./gradlew :iceberg-api:spotlessCheck ./gradlew :iceberg-api:revapi ``` --- **AI Disclosure** - Model: GPT-5 - Platform/Tool: Codex - Human Oversight: partially reviewed - Prompt Summary: Split the pure-Java WKB bounding-box scanner and its tests from the geometry Parquet metrics PR into a focused foundational PR. -- 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]
