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_r389398313
 
 

 ##########
 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:
   For Avro  we assigned ids to fileSchema based on the name mapping  and 
projected ids, which we derived from expected schema. [`Set<Integer> 
projectedIds = TypeUtil.getProjectedIds(expectedSchema)`] . This was piggy 
backed on column pruning code for Avro see - `AvroSchemaUtil.pruneColumns`
   
   I'm unsure whether the same general approach can be applied here as well. 
@rdblue Thoughts?

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