Parquet: Validate geospatial projection parameters - #17578
Open
manuzhang wants to merge 3 commits into
Open
Conversation
Generated-by: Codex
Contributor
There was a problem hiding this comment.
Pull request overview
Validates Parquet geospatial annotations against projected Iceberg types.
Changes:
- Reuses primitive-type conversion for validation.
- Rejects CRS and edge-algorithm mismatches.
- Adds focused geospatial projection tests.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
PruneColumns.java |
Validates projected geospatial parameters. |
MessageTypeToType.java |
Extracts reusable primitive conversion. |
TestPruneColumns.java |
Tests matching and mismatched parameters. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Generated-by: Codex
Generated-by: Codex
manuzhang
marked this pull request as ready for review
August 9, 2026 15:33
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (1)
parquet/src/main/java/org/apache/iceberg/parquet/ParquetSchemaUtil.java:165
- This validates only top-level primitives in the ID-less fallback path. When a selected top-level field is a struct, list, or map, the entire Parquet group is retained unchanged, so any projected nested geometry/geography still bypasses the new CRS/edge-algorithm check and can be read with incompatible parameters. Please traverse each matched group positionally against the projected type and validate its nested primitives as well; add a nested ID-less mismatch test to cover this path.
Types.NestedField expectedField = expectedSchema.findField(ordinal);
if (type.isPrimitive() && expectedField.type().isPrimitiveType()) {
PruneColumns.validatePrimitive(
expectedField.type().asPrimitiveType(), type.asPrimitiveType());
Member
Author
|
@huan233usc Please take a look, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Context
Parquet geospatial values carry their CRS and edge interpolation algorithm in the logical-type annotation rather than in the WKB payload.
PruneColumnspreviously ignored these parameters, so a file could be interpreted using incompatible parameters from the projected Iceberg schema.This is the Java-side counterpart discovered while reviewing apache/iceberg-cpp#880.
Testing
./gradlew :iceberg-parquet:test --tests org.apache.iceberg.parquet.TestPruneColumns./gradlew :iceberg-parquet:spotlessJavaCheckgit diff --checkAI Disclosure