rdblue commented on a change in pull request #227: ORC column map fix
URL: https://github.com/apache/incubator-iceberg/pull/227#discussion_r300067457
##########
File path: orc/src/main/java/org/apache/iceberg/orc/TypeConversion.java
##########
@@ -159,21 +163,45 @@ Type convertOrcToType(TypeDescription schema,
ColumnIdMap columnIds) {
for (int c = 0; c < fieldNames.size(); ++c) {
String name = fieldNames.get(c);
TypeDescription type = fieldTypes.get(c);
- fields.add(Types.NestedField.optional(columnIds.get(type), name,
- convertOrcToType(type, columnIds)));
+ IcebergColumn col = columnIds.get(type);
+ final Types.NestedField field;
+ if (col != null) {
+ field = col.isRequired() ?
+ Types.NestedField.required(col.id(), name,
convertOrcToType(type, columnIds)) :
+ Types.NestedField.optional(col.id(), name,
convertOrcToType(type, columnIds));
+ } else {
+ field = Types.NestedField.optional(type.getId(), name,
convertOrcToType(type, columnIds));
Review comment:
I would probably just add preconditions for this commit and follow up with a
strategy for assigning missing IDs in another PR.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]