aihuaxu commented on code in PR #11831: URL: https://github.com/apache/iceberg/pull/11831#discussion_r1953671095
########## api/src/test/java/org/apache/iceberg/types/TestTypeUtil.java: ########## @@ -645,4 +651,77 @@ public void testReassignOrRefreshIdsCaseInsensitive() { required(2, "FIELD2", Types.IntegerType.get()))); assertThat(actualSchema.asStruct()).isEqualTo(expectedSchema.asStruct()); } + + private static Stream<Arguments> testTypes() { + return Stream.of( + Arguments.of(Types.UnknownType.get()), + Arguments.of(Types.VariantType.get()), + Arguments.of(Types.TimestampNanoType.withoutZone()), + Arguments.of(Types.TimestampNanoType.withZone())); + } + + @ParameterizedTest + @MethodSource("testTypes") + public void testAssignFreshIdsWithType(Type testType) { + Schema schema = + new Schema(required(0, "v", testType), required(1, "A", Types.IntegerType.get())); + Schema sourceSchema = + new Schema(required(1, "v", testType), required(2, "A", Types.IntegerType.get())); + + Schema assignedSchema = + TypeUtil.assignFreshIds(sourceSchema, new AtomicInteger(10)::incrementAndGet); Review Comment: You are right. I just need one schema. I may not get the following: seems we can test for unknown and other primitive types here as well to make sure the correct type is returned, not null. > we only need on test with a variant here. Other tests with more logic for primitives may need more cases though. -- 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