Skip to content

Commit

Permalink
verify that default schema evolution comment is set
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-bzabek committed Dec 3, 2024
1 parent bd435b1 commit 73505ec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public void testEvolutionOfPrimitives_withSchema(
private static Stream<Arguments> primitiveEvolutionDataSource() {
return Stream.of(
Arguments.of(
singleBooleanField(),
singleBooleanFieldWithSchema(),
booleanAndIntWithSchema(),
booleanAndAllKindsOfIntWithSchema(),
allPrimitivesWithSchema(),
Expand Down Expand Up @@ -486,12 +486,19 @@ private static Stream<Arguments> 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<DescribeTableRow> 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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static String complexPayloadWithSchema() {
+ " }"
+ " }";

static String singleBooleanField() {
static String singleBooleanFieldWithSchema() {
return SCHEMA_BEGINNING
+ BOOL_SCHEMA
+ SCHEMA_END
Expand Down

0 comments on commit 73505ec

Please sign in to comment.