rdsr commented on a change in pull request #1208:
URL: https://github.com/apache/iceberg/pull/1208#discussion_r460376124
##########
File path: orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java
##########
@@ -73,7 +78,15 @@
public CloseableIterator<T> iterator() {
Reader orcFileReader = ORC.newFileReader(file, config);
addCloseable(orcFileReader);
- TypeDescription readOrcSchema = ORCSchemaUtil.buildOrcProjection(schema,
orcFileReader.getSchema());
+
+ TypeDescription fileSchema = orcFileReader.getSchema();
+ final TypeDescription readOrcSchema;
+ if (ORCSchemaUtil.hasIds(fileSchema)) {
+ readOrcSchema = ORCSchemaUtil.buildOrcProjection(schema, fileSchema);
+ } else {
+ TypeDescription typeWithIds = ORCSchemaUtil.applyNameMapping(fileSchema,
nameMapping);
Review comment:
Seems like `buildOrcProjection` is handling it by traversing iceberg
read schema to build the read projection
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]