rdsr commented on a change in pull request #830: Support name mapping 
resolution for parquet
URL: https://github.com/apache/incubator-iceberg/pull/830#discussion_r389398129
 
 

 ##########
 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);
+
     this.rowGroups = reader.getRowGroups();
     this.shouldSkip = new boolean[rowGroups.size()];
 
     ParquetMetricsRowGroupFilter statsFilter = null;
     ParquetDictionaryRowGroupFilter dictFilter = null;
     if (filter != null) {
-      statsFilter = new ParquetMetricsRowGroupFilter(expectedSchema, filter, 
caseSensitive);
-      dictFilter = new ParquetDictionaryRowGroupFilter(expectedSchema, filter, 
caseSensitive);
+      NameMapping nameMapping = 
MappingUtil.create(ParquetSchemaUtil.convert(fileSchema));
 
 Review comment:
   I think the `nameMapping` should be taken as a parameter in `Parquet` as 
part of the builder and passed in from there

----------------------------------------------------------------
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

Reply via email to