rdblue commented on code in PR #12238:
URL: https://github.com/apache/iceberg/pull/12238#discussion_r1955059718


##########
core/src/test/java/org/apache/iceberg/avro/TestAvroSchemaProjection.java:
##########
@@ -150,4 +150,58 @@ public void projectWithMapSchemaChanged() {
         .as("Result of buildAvroProjection is missing some IDs")
         .isFalse();
   }
+
+  @Test
+  public void projectWithVariantSchemaChanged() {
+    final org.apache.avro.Schema currentAvroSchema =
+        SchemaBuilder.record("myrecord")
+            .fields()
+            .name("f11")
+            .type()
+            .nullable()
+            .intType()
+            .noDefault()
+            .endRecord();
+
+    final org.apache.avro.Schema variantSchema =
+        SchemaBuilder.record("v")
+            .fields()
+            .name("metadata")
+            .type()
+            .bytesType()
+            .noDefault()
+            .name("value")
+            .type()
+            .bytesType()
+            .noDefault()
+            .endRecord();
+    Variant.get().addToSchema(variantSchema);
+
+    final org.apache.avro.Schema updatedAvroSchema =
+        SchemaBuilder.record("myrecord")
+            .fields()
+            .name("f11")
+            .type()
+            .nullable()
+            .intType()
+            .noDefault()

Review Comment:
   If it is nullable, it should have a null default. Maybe that's what happens 
anyway since that is represented as null/missing?



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to