Guosmilesmile commented on code in PR #16575:
URL: https://github.com/apache/iceberg/pull/16575#discussion_r3308679075
##########
data/src/test/java/org/apache/iceberg/data/BaseFormatModelTests.java:
##########
@@ -1662,6 +1598,68 @@ 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);
+
+ genericRecords = dataGenerator.generateRecords();
+ writeEngineRecords(fileFormat, schema,
convertToEngineRecords(genericRecords, schema), true);
+ readAndAssertGenericRecords(fileFormat, schema, genericRecords);
+ }
+
+ @ParameterizedTest
+ @FieldSource("FILE_FORMATS")
+ void testDataWriterSet(FileFormat fileFormat) throws IOException {
Review Comment:
For now I can found the same property for all format is comress type, so
test it in this part.
--
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]