Copilot commented on code in PR #17578:
URL: https://github.com/apache/iceberg/pull/17578#discussion_r3744274352
##########
parquet/src/main/java/org/apache/iceberg/parquet/PruneColumns.java:
##########
@@ -162,6 +166,14 @@ public Type variant(
@Override
public Type primitive(
org.apache.iceberg.types.Type.PrimitiveType expected, PrimitiveType
primitive) {
+ if (expected != null && (expected.typeId() == GEOMETRY ||
expected.typeId() == GEOGRAPHY)) {
+ Preconditions.checkArgument(
+
TypeUtil.isPromotionAllowed(MessageTypeToType.convertPrimitive(primitive),
expected),
Review Comment:
This validation is bypassed for Parquet files without field IDs and without
a name mapping. Both `ParquetReadSupport` and `ReadConf` route those files
through `pruneColumnsFallback`, which copies columns directly and never invokes
this visitor, so an incompatible geospatial CRS or edge algorithm can still be
read silently. Apply the same parameter validation in the fallback projection
path (and cover it with a no-ID mismatch test).
--
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]