pvary commented on code in PR #11430:
URL: https://github.com/apache/iceberg/pull/11430#discussion_r1827556254
##########
flink/v1.20/flink/src/test/java/org/apache/iceberg/flink/data/AbstractTestFlinkAvroReaderWriter.java:
##########
@@ -80,20 +79,27 @@ private void writeAndValidate(Schema schema, List<Record>
expectedRecords, int n
// Write the expected records into AVRO file, then read them into RowData
and assert with the
// expected Record list.
- try (FileAppender<Record> writer =
+ try (FileAppender<org.apache.iceberg.data.Record> writer =
Avro.write(Files.localOutput(recordsFile))
.schema(schema)
.createWriterFunc(DataWriter::create)
.build()) {
writer.addAll(expectedRecords);
}
- try (CloseableIterable<RowData> reader =
+ Avro.ReadBuilder builder =
Avro.read(Files.localInput(recordsFile))
.project(schema)
- .createResolvingReader(FlinkPlannedAvroReader::create)
- .build()) {
- Iterator<Record> expected = expectedRecords.iterator();
+ .createReaderFunc(FlinkAvroReader::new);
+ if (useAvroPlannedReader) {
+ builder =
+ Avro.read(Files.localInput(recordsFile))
+ .project(schema)
+ .createResolvingReader(FlinkPlannedAvroReader::create);
+ }
Review Comment:
Maybe put this in an abstract method and use it inside the
`writeAndValidate`?
Something like:
```
abstract Avro.ReadBuilder builder() {
```
--
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]