Source:
public Block readBlock(Type type) throws IOException { if (!rowGroupOpen) { openRowGroup(); } if (readOffset > 0) { if (presentStream != null) { readOffset = presentStream.countBitsSet(readOffset); } if (readOffset > 0) { if (lengthStream == null) { throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Value is not null but data stream is not present"); } long elementSkipSize = lengthStream.sum(readOffset); elementStreamReader.prepareNextRead(toIntExact(elementSkipSize)); } } int[] offsetVector = new int[nextBatchSize + 1]; boolean[] nullVector = null; if (presentStream == null) { if (lengthStream == null) { throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Value is not null but data stream is not present"); } lengthStream.nextIntVector(nextBatchSize, offsetVector, 0); } else { nullVector = new boolean[nextBatchSize]; int nullValues = presentStream.getUnsetBits(nextBatchSize, nullVector); if (nullValues != nextBatchSize) { if (lengthStream == null) { throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Value is not null but data stream is not present"); } lengthStream.nextIntVector(nextBatchSize, offsetVector, 0, nullVector); } } int currentLength = offsetVector[0]; offsetVector[0] = 0; for (int i = 1; i < offsetVector.length; i++) { int nextLength = offsetVector[i]; offsetVector[i] = offsetVector[i - 1] + currentLength; currentLength = nextLength; } Type elementType = type.getTypeParameters().get(0); int elementCount = offsetVector[offsetVector.length - 1]; Block elements; if (elementCount > 0) { elementStreamReader.prepareNextRead(elementCount); elements = elementStreamReader.readBlock(elementType); } else { elements = elementType.createBlockBuilder(null, 0).build(); } Block arrayBlock = ArrayBlock.fromElementBlock(nextBatchSize, nullVector, offsetVector, elements); readOffset = 0; nextBatchSize = 0; return arrayBlock; }

Target:
public Block readBlock(Type type) throws IOException { if (!rowGroupOpen) { openRowGroup(); } if (readOffset > 0) { if (presentStream != null) { readOffset = presentStream.countBitsSet(readOffset); } if (readOffset > 0) { if (lengthStream == null) { throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Value is not null but data stream is not present"); } long elementSkipSize = lengthStream.sum(readOffset); elementStreamReader.prepareNextRead(toIntExact(elementSkipSize)); } } int[] offsetVector = new int[nextBatchSize + 1]; boolean[] nullVector = null; if (presentStream == null) { if (lengthStream == null) { throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Value is not null but data stream is not present"); } lengthStream.nextIntVector(nextBatchSize, offsetVector, 0); } else { nullVector = new boolean[nextBatchSize]; int nullValues = presentStream.getUnsetBits(nextBatchSize, nullVector); if (nullValues != nextBatchSize) { if (lengthStream == null) { throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Value is not null but data stream is not present"); } lengthStream.nextIntVector(nextBatchSize, offsetVector, 0, nullVector); } } int currentLength = offsetVector[0]; offsetVector[0] = 0; for (int i = 1; i < offsetVector.length; i++) { int nextLength = offsetVector[i]; offsetVector[i] = offsetVector[i - 1] + currentLength; currentLength = nextLength; } Type elementType = type.getTypeParameters().get(0); int elementCount = offsetVector[offsetVector.length - 1]; Block elements; if (elementCount > 0) { elementStreamReader.prepareNextRead(elementCount); elements = elementStreamReader.readBlock(elementType); } else { elements = elementType.createBlockBuilder(null, 0).build(); } Block arrayBlock = ArrayBlock.fromElementBlock(nextBatchSize, Optional.ofNullable(nullVector), offsetVector, elements); readOffset = 0; nextBatchSize = 0; return arrayBlock; }