pvary commented on code in PR #17610:
URL: https://github.com/apache/iceberg/pull/17610#discussion_r4337299383
##########
data/src/test/java/org/apache/iceberg/data/ReadFormatModelTests.java:
##########
@@ -303,15 +346,17 @@ void testEqualityDeleteWriterGenericWriteEngineRead(
// Read back and verify
InputFile inputFile = encryptedFile.encryptingOutputFile().toInputFile();
- List<T> readRecords;
- try (CloseableIterable<T> reader =
- FormatModelRegistry.readBuilder(fileFormat, engineType(), inputFile)
- .project(schema)
- .build()) {
- readRecords = ImmutableList.copyOf(reader);
+
+ ReadBuilder<T, ?> builder =
+ FormatModelRegistry.readBuilder(fileFormat, engineType(),
inputFile).project(schema);
+
+ if (supportsBatchReads()) {
+ builder.recordsPerBatch(2);
}
Review Comment:
Could we create a shared builder helper, like:
```
private ReadBuilder<T, ?> readBuilder(FileFormat format, InputFile file) {
ReadBuilder<T, ?> builder = FormatModelRegistry.readBuilder(format,
engineType(), file);
return supportsBatchReads() ? builder.recordsPerBatch(3) : builder;
}
```
Notice: used 3 instead of 2, so we have partial batches
--
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]