twuebi commented on PR #605:
URL: https://github.com/apache/iceberg-go/pull/605#issuecomment-3450633489

   @dttung2905, it's supported in nested types:
   
   `org.apache.iceberg.TestSchema#testUnknownSupport`
   
   ```java
     @Test
     public void testUnknownSupport() {
       // this needs a different schema because it cannot be used in required 
fields
       Schema schemaWithUnknown =
           new Schema(
               Types.NestedField.required(1, "id", Types.LongType.get()),
               Types.NestedField.optional(2, "top", Types.UnknownType.get()),
               Types.NestedField.optional(
                   3, "arr", Types.ListType.ofOptional(4, 
Types.UnknownType.get())),
               Types.NestedField.required(
                   5,
                   "struct",
                   Types.StructType.of(
                       Types.NestedField.optional(6, "inner_op", 
Types.UnknownType.get()),
                       Types.NestedField.optional(
                           7,
                           "inner_map",
                           Types.MapType.ofOptional(
                               8, 9, Types.StringType.get(), 
Types.UnknownType.get())),
                       Types.NestedField.optional(
                           10,
                           "struct_arr",
                           Types.StructType.of(
                               Types.NestedField.optional(11, "deep", 
Types.UnknownType.get()))))));
   
       assertThatThrownBy(() -> Schema.checkCompatibility(schemaWithUnknown, 2))
           .isInstanceOf(IllegalStateException.class)
           .hasMessage(
               "Invalid schema for v%s:\n"
                   + "- Invalid type for top: %s is not supported until v%s\n"
                   + "- Invalid type for arr.element: %s is not supported until 
v%s\n"
                   + "- Invalid type for struct.inner_op: %s is not supported 
until v%s\n"
                   + "- Invalid type for struct.inner_map.value: %s is not 
supported until v%s\n"
                   + "- Invalid type for struct.struct_arr.deep: %s is not 
supported until v%s",
               2,
               Types.UnknownType.get(),
               MIN_FORMAT_VERSIONS.get(Type.TypeID.UNKNOWN),
               Types.UnknownType.get(),
               MIN_FORMAT_VERSIONS.get(Type.TypeID.UNKNOWN),
               Types.UnknownType.get(),
               MIN_FORMAT_VERSIONS.get(Type.TypeID.UNKNOWN),
               Types.UnknownType.get(),
               MIN_FORMAT_VERSIONS.get(Type.TypeID.UNKNOWN),
               Types.UnknownType.get(),
               MIN_FORMAT_VERSIONS.get(Type.TypeID.UNKNOWN));
   
       assertThatCode(() -> Schema.checkCompatibility(schemaWithUnknown, 3))
           .doesNotThrowAnyException();
     }
   ```


-- 
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]

Reply via email to