rdblue commented on code in PR #11831:
URL: https://github.com/apache/iceberg/pull/11831#discussion_r1942102793
##########
core/src/test/java/org/apache/iceberg/avro/TestSchemaConversions.java:
##########
@@ -370,4 +370,17 @@ public void testFieldDocsArePreserved() {
Lists.newArrayList(Iterables.transform(origSchema.columns(),
Types.NestedField::doc));
assertThat(fieldDocs).isEqualTo(origFieldDocs);
}
+
+ @Test
+ public void testVariantConversion() {
+ org.apache.iceberg.Schema schema =
+ new org.apache.iceberg.Schema(required(1, "variantCol",
Types.VariantType.get()));
+ org.apache.avro.Schema avroSchema =
AvroSchemaUtil.convert(schema.asStruct());
+
+ org.apache.avro.Schema variantSchema =
avroSchema.getField("variantCol").schema();
Review Comment:
I think we also need a test that multiple variant columns can be converted
in a single Avro record.
Other test cases (like `testPrimitiveTypes`) validate Avro to Iceberg
conversion. Do you want to add that as well?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]