RussellSpitzer commented on code in PR #13935:
URL: https://github.com/apache/iceberg/pull/13935#discussion_r2304800923
##########
spark/v3.4/spark/src/test/java/org/apache/iceberg/spark/data/parquet/vectorized/TestParquetVectorizedReads.java:
##########
@@ -161,28 +164,34 @@ void assertRecordsMatch(
boolean reuseContainers,
int batchSize)
throws IOException {
- Parquet.ReadBuilder readBuilder =
- Parquet.read(inputFile)
- .project(schema)
- .recordsPerBatch(batchSize)
- .createBatchedReaderFunc(
- type ->
- VectorizedSparkParquetReaders.buildReader(
- schema, type, Maps.newHashMap(), null));
- if (reuseContainers) {
- readBuilder.reuseContainers();
- }
- try (CloseableIterable<ColumnarBatch> batchReader = readBuilder.build()) {
- Iterator<GenericData.Record> expectedIter = expected.iterator();
- Iterator<ColumnarBatch> batches = batchReader.iterator();
- int numRowsRead = 0;
- while (batches.hasNext()) {
- ColumnarBatch batch = batches.next();
- numRowsRead += batch.numRows();
- TestHelpers.assertEqualsBatch(schema.asStruct(), expectedIter, batch);
- }
- assertThat(numRowsRead).isEqualTo(expectedSize);
- }
+ assertNoLeak(
+ "testRecordsMatch",
+ allocator -> {
+ Parquet.ReadBuilder readBuilder =
+ Parquet.read(inputFile)
+ .project(schema)
+ .recordsPerBatch(batchSize)
+ .createBatchedReaderFunc(
+ type ->
+ VectorizedSparkParquetReaders.buildReader(
+ schema, type, Maps.newHashMap(), null,
allocator));
Review Comment:
The only change to the actual test code is here, to pass in the allocator
--
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]