pvary commented on code in PR #16575:
URL: https://github.com/apache/iceberg/pull/16575#discussion_r3311442887
##########
data/src/test/java/org/apache/iceberg/data/BaseFormatModelTests.java:
##########
@@ -1662,6 +1598,69 @@ void
testReadFileWithoutFieldIdsUsingNameMapping(FileFormat fileFormat) throws I
assertEquals(icebergSchema, convertToEngineRecords(genericRecords,
icebergSchema), readRecords);
}
+ @ParameterizedTest
+ @FieldSource("FILE_FORMATS")
+ void testDataWriterOverwrite(FileFormat fileFormat) throws IOException {
+ DataGenerator dataGenerator = new DataGenerators.DefaultSchema();
+ Schema schema = dataGenerator.schema();
+
+ List<Record> genericRecords = dataGenerator.generateRecords();
+ List<T> engineRecords = convertToEngineRecords(genericRecords, schema);
+
+ writeEngineRecords(fileFormat, schema, engineRecords);
+ readAndAssertGenericRecords(fileFormat, schema, genericRecords);
+
+ assertThatThrownBy(() -> writeEngineRecords(fileFormat, schema,
engineRecords))
+ .isInstanceOf(AlreadyExistsException.class)
+ .hasMessageContaining("Already exists");
+
+ genericRecords = dataGenerator.generateRecords();
Review Comment:
I would guess that this is the same records as previously. We might want to
generate new records
--
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]