rdblue commented on a change in pull request #830: Support name mapping resolution for parquet URL: https://github.com/apache/incubator-iceberg/pull/830#discussion_r404459844
########## File path: parquet/src/main/java/org/apache/iceberg/parquet/ReadConf.java ########## @@ -59,42 +61,46 @@ private final boolean reuseContainers; @Nullable private final Integer batchSize; + @Nullable + private final NameMapping nameMapping; // List of column chunk metadata for each row group private final List<Map<ColumnPath, ColumnChunkMetaData>> columnChunkMetaDataForRowGroups; @SuppressWarnings("unchecked") ReadConf(InputFile file, ParquetReadOptions options, Schema expectedSchema, Expression filter, Function<MessageType, ParquetValueReader<?>> readerFunc, Function<MessageType, - VectorizedReader<?>> batchedReaderFunc, boolean reuseContainers, + VectorizedReader<?>> batchedReaderFunc, NameMapping nameMapping, boolean reuseContainers, boolean caseSensitive, Integer bSize) { this.file = file; 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.nameMapping = nameMapping == null ? MappingUtil.create(expectedSchema) : nameMapping; Review comment: This is not the right place to infer a name mapping. This class should apply the name mapping if it exists, and use a position-based fallback otherwise. ---------------------------------------------------------------- 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