public static StructTreeReader createRootTreeReader(TypeDescription[] batchSchemas,
List<OrcProto.ColumnEncoding> encodings, OrcEncodedColumnBatch batch,
CompressionCodec codec, Context context, final boolean useDecimal64ColumnVectors) throws IOException {
int includedCount = batch.getColumnsWithDataCount();
if (batchSchemas.length > includedCount) {
throw new AssertionError("For " + Arrays.toString(batchSchemas) + ", only received "
+ includedCount + " columns");
}
TreeReader[] childReaders = new TreeReader[batchSchemas.length];
for (int i = 0; i < batchSchemas.length; ++i) {
int batchColIx = batchSchemas[i].getId();
if (!batch.hasData(batchColIx) && !batch.hasVectors(batchColIx)) {
throw new AssertionError("No data for column " + batchColIx + ": " + batchSchemas[i]);
}
childReaders[i] = createEncodedTreeReader(batchSchemas[i], encodings, batch, codec, context, useDecimal64ColumnVectors);
}
return StructStreamReader.builder()
.setColumnIndex(0)
.setCompressionCodec(codec)
.setColumnEncoding(encodings.get(0))
.setChildReaders(childReaders)
.setContext(context)
.build();
}