edgarRd commented on a change in pull request #1140:
URL: https://github.com/apache/iceberg/pull/1140#discussion_r449172289
##########
File path: orc/src/test/java/org/apache/iceberg/orc/TestORCSchemaUtil.java
##########
@@ -209,4 +210,39 @@ public void testInvalidTypePromotions() {
ORCSchemaUtil.buildOrcProjection(evolveSchema, orcSchema);
});
}
+
+ @Test
+ public void testSkipNonIcebergColumns() {
+ TypeDescription schema = TypeDescription.createStruct();
+ TypeDescription intCol = TypeDescription.createInt();
+ intCol.setAttribute(ICEBERG_ID_ATTRIBUTE, "1");
+ TypeDescription listCol = TypeDescription
+ .createList(TypeDescription.createMap(TypeDescription.createString(),
TypeDescription.createDate()));
+ listCol.setAttribute(ICEBERG_ID_ATTRIBUTE, "2");
+ schema.addField("intCol", intCol);
+ schema.addField("listCol", listCol);
+ TypeDescription stringKey = TypeDescription.createString();
+ stringKey.setAttribute(ICEBERG_ID_ATTRIBUTE, "3");
+ TypeDescription booleanVal = TypeDescription.createBoolean();
+ booleanVal.setAttribute(ICEBERG_ID_ATTRIBUTE, "4");
+ TypeDescription mapCol = TypeDescription.createMap(stringKey, booleanVal);
+ mapCol.setAttribute(ICEBERG_ID_ATTRIBUTE, "5");
+ schema.addField("mapCol", mapCol);
+
+ Schema icebergSchema = ORCSchemaUtil.convert(schema);
+ assertEquals(2, icebergSchema.asStruct().fields().size());
Review comment:
Done. I've changed the test to compare structs.
----------------------------------------------------------------
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]