chenjunjiedada commented on a change in pull request #830: Support name mapping resolution for parquet URL: https://github.com/apache/incubator-iceberg/pull/830#discussion_r390070742
########## File path: parquet/src/main/java/org/apache/iceberg/parquet/ReadConf.java ########## @@ -72,29 +74,31 @@ this.options = options; this.reader = newReader(file, options); MessageType fileSchema = reader.getFileMetaData().getSchema(); - boolean hasIds = ParquetSchemaUtil.hasIds(fileSchema); - MessageType typeWithIds = hasIds ? fileSchema : ParquetSchemaUtil.addFallbackIds(fileSchema); this.projection = hasIds ? - ParquetSchemaUtil.pruneColumns(fileSchema, expectedSchema) : - ParquetSchemaUtil.pruneColumnsFallback(fileSchema, expectedSchema); + ParquetSchemaUtil.pruneColumns(fileSchema, expectedSchema) : + ParquetSchemaUtil.pruneColumnsByName(fileSchema, expectedSchema); Review comment: Here is a reversed way. I build name mapping based on `fileSchema`, and then project ids for expected schema according to names. The reason is the metrics are built from parquet footer so we have to bind the expression to `fileSchema` instead of expected schema in `ParquetMetricsRowGroupFilter` and `ParquetDictionaryRowGroupFilter`. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org