diff --git a/src/test/java/com/snowflake/kafka/connector/streaming/iceberg/IcebergIngestionSchemaEvolutionIT.java b/src/test/java/com/snowflake/kafka/connector/streaming/iceberg/IcebergIngestionSchemaEvolutionIT.java index 681d5b57c..4eac3779e 100644 --- a/src/test/java/com/snowflake/kafka/connector/streaming/iceberg/IcebergIngestionSchemaEvolutionIT.java +++ b/src/test/java/com/snowflake/kafka/connector/streaming/iceberg/IcebergIngestionSchemaEvolutionIT.java @@ -384,7 +384,7 @@ public void testEvolutionOfPrimitives_withSchema( private static Stream primitiveEvolutionDataSource() { return Stream.of( Arguments.of( - singleBooleanField(), + singleBooleanFieldWithSchema(), booleanAndIntWithSchema(), booleanAndAllKindsOfIntWithSchema(), allPrimitivesWithSchema(), @@ -486,12 +486,19 @@ private static Stream testEvolutionOfComplexTypes_dataSource() { @Test @Disabled - void shouldAppendedCommentTest() throws Exception { + void shouldAppendCommentTest() throws Exception { // when + // insert record with a comment insertWithRetry(schemaAndPayloadWithComment(), 0, true); - waitForOffset(1); + // insert record without a comment + insertWithRetry(singleBooleanFieldWithSchema(), 1, true); + waitForOffset(2); + // then + // comment is read from schema and set into first column List columns = describeTable(tableName); assertEquals("Test comment", columns.get(1).getComment()); + // default comment is set into second column + assertEquals("column created by schema evolution from Snowflake Kafka Connector", columns.get(2).getComment()); } } diff --git a/src/test/java/com/snowflake/kafka/connector/streaming/iceberg/TestJsons.java b/src/test/java/com/snowflake/kafka/connector/streaming/iceberg/TestJsons.java index dd2a539ea..59ca9e89f 100644 --- a/src/test/java/com/snowflake/kafka/connector/streaming/iceberg/TestJsons.java +++ b/src/test/java/com/snowflake/kafka/connector/streaming/iceberg/TestJsons.java @@ -142,7 +142,7 @@ static String complexPayloadWithSchema() { + " }" + " }"; - static String singleBooleanField() { + static String singleBooleanFieldWithSchema() { return SCHEMA_BEGINNING + BOOL_SCHEMA + SCHEMA_END