szehon-ho commented on code in PR #17161:
URL: https://github.com/apache/iceberg/pull/17161#discussion_r3993642179
##########
parquet/src/main/java/org/apache/iceberg/data/parquet/BaseParquetWriter.java:
##########
@@ -268,8 +268,11 @@ public Optional<ParquetValueWriter<?>> visit(
@Override
public Optional<ParquetValueWriter<?>> visit(
LogicalTypeAnnotation.GeometryLogicalTypeAnnotation geometryType) {
- // geometry values are pure WKB stored in a BINARY column
- return Optional.of(ParquetValueWriters.geospatial(desc));
+ // geometry values are pure WKB stored in a BINARY column; the writer
also scans the
+ // coordinates to produce a bounding box (the Parquet footer cannot).
The concrete CRS is
+ // immaterial here: ParquetMetrics rewrites the bound's type from the
table schema before
+ // serialization, and the serialization is keyed on the type id, which
ignores the CRS.
+ return Optional.of(ParquetValueWriters.geometry(desc,
Types.GeometryType.crs84()));
Review Comment:
Could we avoid scanning WKB when the configured metrics mode does not retain
bounds? `none` and `counts` still walk every coordinate and discard the result,
which may add substantial CPU overhead for complex geometries.
--
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]