tmater opened a new pull request, #14617: URL: https://github.com/apache/iceberg/pull/14617
# Fix NameMapping loss in ParquetUtil.footerMetrics ## Summary Fixed a bug where `ParquetUtil.footerMetrics` was losing field IDs when using NameMapping, resulting in empty metrics for Parquet files without embedded field IDs. ## Background When `footerMetrics` is called with a NameMapping, it applies the mapping to get field IDs via `getParquetTypeWithIds()`, but then passed the original MessageType to `ParquetMetrics.metrics`. Later in the `metrics()` call, field IDs are extracted from the MessageType via `type.getColumnDescription().getPrimitiveType().getId()`, which returns null for the original MessageType without IDs, causing all metrics to be skipped. ## Changes - Pass `parquetTypeWithIds` to `ParquetMetrics.metrics` to preserve field IDs from NameMapping - Removed unused `messageType` variable ## Testing - Added `testFooterMetricsWithNameMappingForFileWithoutIds` that verifies metrics are keyed by field IDs from NameMapping -- 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]
