Skip to content

Commit

Permalink
revert new test addition to IcebergIngestionSchemaEvolutionIT
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-bzabek committed Nov 14, 2024
1 parent f0d29e6 commit 197770f
Showing 1 changed file with 0 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,50 +81,6 @@ void shouldEvolveSchemaAndInsertRecords(
assertRecordsInTable();
}

@ParameterizedTest(name = "{0}")
@MethodSource("prepareData")
@Disabled
// Schema evolution for structured types is not yet supported
void shouldEvolveSchemaAndInsertRecords_structuredData(
String description, String message, DescribeTableRow[] expectedSchema, boolean withSchema)
throws Exception {
// start off with just one column
List<DescribeTableRow> rows = describeTable(tableName);
assertThat(rows)
.hasSize(1)
.extracting(DescribeTableRow::getColumn)
.contains(Utils.TABLE_COLUMN_METADATA);

SinkRecord record = createKafkaRecord(message, 0, withSchema);
service.insert(Collections.singletonList(record));
waitForOffset(-1);
rows = describeTable(tableName);
assertThat(rows.size()).isEqualTo(9);

// don't check metadata column schema, we have different tests for that
rows =
rows.stream()
.filter(r -> !r.getColumn().equals(Utils.TABLE_COLUMN_METADATA))
.collect(Collectors.toList());

assertThat(rows).containsExactlyInAnyOrder(expectedSchema);

// resend and store same record without any issues now
service.insert(Collections.singletonList(record));
waitForOffset(1);

// and another record with same schema
service.insert(Collections.singletonList(createKafkaRecord(message, 1, withSchema)));
waitForOffset(2);

String testStruct = "{ \"testStruct\": {" + "\"k1\" : 1," + "\"k2\" : 2" + "} " + "}";

service.insert(Collections.singletonList(createKafkaRecord(testStruct, 2, false)));

service.insert(Collections.singletonList(createKafkaRecord(testStruct, 2, false)));
waitForOffset(3);
}

private void assertRecordsInTable() {
List<RecordWithMetadata<PrimitiveJsonRecord>> recordsWithMetadata =
selectAllSchematizedRecords();
Expand Down

0 comments on commit 197770f

Please sign in to comment.