Source:
private ColumnChunk readPrimitive(PrimitiveField field) throws IOException { ColumnDescriptor columnDescriptor = field.getDescriptor(); int fieldId = field.getId(); ColumnReader columnReader = columnReaders[fieldId]; if (!columnReader.isInitialized()) { validateParquet(currentBlockMetadata.getRowCount() > 0, "Row group has 0 rows"); ColumnChunkMetaData metadata = getColumnChunkMetaData(columnDescriptor); long startingPosition = metadata.getStartingPos(); int totalSize = toIntExact(metadata.getTotalSize()); byte[] buffer = allocateBlock(totalSize); dataSource.readFully(startingPosition, buffer); ColumnChunkDescriptor descriptor = new ColumnChunkDescriptor(columnDescriptor, metadata, totalSize); ParquetColumnChunk columnChunk = new ParquetColumnChunk(descriptor, buffer, 0); columnReader.init(columnChunk.readAllPages(), field); if (enableVerification) { ColumnReader verificationColumnReader = verificationColumnReaders[field.getId()]; ParquetColumnChunk columnChunkVerfication = new ParquetColumnChunk(descriptor, buffer, 0); verificationColumnReader.init(columnChunkVerfication.readAllPages(), field); } } ColumnChunk columnChunk = columnReader.readNext(); columnChunk = rewriteIfNeeded(columnChunk, field.getDescriptor().getPrimitiveType().getPrimitiveTypeName(), field.getType()); if (enableVerification) { ColumnReader verificationColumnReader = verificationColumnReaders[field.getId()]; ColumnChunk expected = verificationColumnReader.readNext(); ParquetResultVerifierUtils.verifyColumnChunks(columnChunk, expected, columnDescriptor.getPath().length > 1, field, dataSource.getId()); } long bytesPerCell = columnChunk.getBlock().getSizeInBytes() / batchSize; if (maxBytesPerCell[fieldId] < bytesPerCell) { maxCombinedBytesPerRow = maxCombinedBytesPerRow - maxBytesPerCell[fieldId] + bytesPerCell; maxBatchSize = toIntExact(min(maxBatchSize, max(1, maxReadBlockBytes / maxCombinedBytesPerRow))); maxBytesPerCell[fieldId] = bytesPerCell; } return columnChunk; }

Target:
private ColumnChunk readPrimitive(PrimitiveField field) throws IOException { ColumnDescriptor columnDescriptor = field.getDescriptor(); int fieldId = field.getId(); ColumnReader columnReader = columnReaders[fieldId]; if (!columnReader.isInitialized()) { validateParquet(currentBlockMetadata.getRowCount() > 0, "Row group has 0 rows"); ColumnChunkMetaData metadata = getColumnChunkMetaData(columnDescriptor); long startingPosition = metadata.getStartingPos(); int totalSize = toIntExact(metadata.getTotalSize()); byte[] buffer = allocateBlock(totalSize); dataSource.readFully(startingPosition, buffer); ColumnChunkDescriptor descriptor = new ColumnChunkDescriptor(columnDescriptor, metadata, totalSize); ParquetColumnChunk columnChunk = new ParquetColumnChunk(descriptor, buffer, 0); columnReader.init(columnChunk.readAllPages(), field); if (enableVerification) { ColumnReader verificationColumnReader = verificationColumnReaders[field.getId()]; ParquetColumnChunk columnChunkVerfication = new ParquetColumnChunk(descriptor, buffer, 0); verificationColumnReader.init(columnChunkVerfication.readAllPages(), field); } } ColumnChunk columnChunk = columnReader.readNext(); columnChunk = typeCoercion(columnChunk, field.getDescriptor().getPrimitiveType().getPrimitiveTypeName(), field.getType()); if (enableVerification) { ColumnReader verificationColumnReader = verificationColumnReaders[field.getId()]; ColumnChunk expected = verificationColumnReader.readNext(); ParquetResultVerifierUtils.verifyColumnChunks(columnChunk, expected, columnDescriptor.getPath().length > 1, field, dataSource.getId()); } long bytesPerCell = columnChunk.getBlock().getSizeInBytes() / batchSize; if (maxBytesPerCell[fieldId] < bytesPerCell) { maxCombinedBytesPerRow = maxCombinedBytesPerRow - maxBytesPerCell[fieldId] + bytesPerCell; maxBatchSize = toIntExact(min(maxBatchSize, max(1, maxReadBlockBytes / maxCombinedBytesPerRow))); maxBytesPerCell[fieldId] = bytesPerCell; } return columnChunk; }