Minghan2005 opened a new pull request, #11307: URL: https://github.com/apache/arrow-rs/pull/11307
# Which issue does this PR close? - Closes #10822. # Rationale for this change The `wkb` reader masks the ISO WKB geometry code to its lowest three bits. Extension geometries such as `PolyhedralSurface` and `Triangle` can consequently be interpreted as `GeometryCollection` or `Point`, yielding incorrect type metadata or bounds. Parquet geospatial bounds are used for row-group pruning, so an invalid bound can omit matching rows. # What changes are included in this PR? - Validate the WKB geometry structure before passing it to the current reader, rejecting geometry types outside the seven types supported by `GeometryBounder`. - Validate nested members and enforce the child type, dimensional model, byte order, and SRID layouts that the current `wkb` reader assumes for multi-geometries. This prevents unsupported or malformed members from being converted into incorrect bounds or reaching a panic path. - Keep the existing accumulator behavior: once a geometry cannot be bounded safely, omit statistics for that row group. - Add regression coverage for PolyhedralSurface, Triangle, TIN, nested extension geometries, MultiPoint child mismatches, Z/M dimension mismatches, big-endian input, EWKB with Z/M/SRID flags, and accumulator invalidation. # Are these changes tested? - `cargo test -p parquet-geospatial` — 41 passed. - `cargo test -p parquet --features geospatial` — 1348 unit tests passed; 114 Arrow reader integration tests, 89 Arrow writer integration tests, 2 encryption tests, 9 geospatial tests, 2 IEEE754 interoperability tests, and 73 doctests passed. Seven doctests were ignored. - `cargo clippy -p parquet-geospatial --all-targets --all-features -- -D warnings` — passed. - `cargo clippy -p parquet --all-targets --all-features --features geospatial -- -D warnings` — passed. - `cargo +stable fmt --all -- --check` — passed. # Are there any user-facing changes? No public API changes. Unsupported WKB extension geometries no longer emit potentially incorrect geospatial statistics; supported basic WKB and EWKB inputs continue to produce statistics. AI assistance: Codex assisted with codebase investigation, implementation, regression tests, verification, and drafting this PR description. The diff also received an independent code review. -- 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]
