mithun-sudo commented on code in PR #18066:
URL: https://github.com/apache/iceberg/pull/18066#discussion_r4026499014
##########
flink/v2.3/flink/src/test/java/org/apache/iceberg/flink/sink/dynamic/TestDynamicIcebergSink.java:
##########
@@ -1902,4 +1904,59 @@ private static Row randomRow(Schema schema, long
seedOverride) {
RandomGenericData.generate(schema, 1, seedOverride), schema)
.get(0);
}
+
+ @Test
+ void testCaseInsensitiveDataConversionDropsValues() throws Exception {
+ Schema tableSchema =
+ new Schema(
+ Types.NestedField.optional(1, "id", Types.IntegerType.get()),
+ Types.NestedField.optional(2, "data", Types.StringType.get()),
+ Types.NestedField.optional(3, "extra", Types.StringType.get()));
+
+ TableIdentifier identifier = TableIdentifier.of(DATABASE, "t1");
+ CATALOG_EXTENSION.catalog().createTable(identifier, tableSchema,
PartitionSpec.unpartitioned());
+
+ DynamicIcebergSink.forInput(env.fromData(1, 2, 3))
+ .generator(new CaseMismatchGenerator())
+ .catalogLoader(CATALOG_EXTENSION.catalogLoader())
+ .writeParallelism(1)
+ .immediateTableUpdate(true)
+ .caseSensitive(false)
+ .append();
+
+ env.execute("case-insensitive data conversion");
+
+ Table table = CATALOG_EXTENSION.catalog().loadTable(identifier);
+ List<Record> records =
Lists.newArrayList(IcebergGenerics.read(table).build());
+
+ assertThat(records).hasSize(3);
+ assertThat(records)
+ .allSatisfy(
+ record -> {
+ assertThat(record.getField("id")).isNotNull();
+ assertThat(record.getField("data")).isNotNull();
Review Comment:
Now asserting id/data values and that extra is null.
--
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]