use of parquet.column.values.ValuesReader in project presto by prestodb.
the class ParquetColumnReader method readPageV1.
private ValuesReader readPageV1(ParquetDataPageV1 page) {
ValuesReader rlReader = page.getRepetitionLevelEncoding().getValuesReader(columnDescriptor, REPETITION_LEVEL);
ValuesReader dlReader = page.getDefinitionLevelEncoding().getValuesReader(columnDescriptor, DEFINITION_LEVEL);
repetitionReader = new ParquetLevelValuesReader(rlReader);
definitionReader = new ParquetLevelValuesReader(dlReader);
try {
byte[] bytes = page.getSlice().getBytes();
rlReader.initFromPage(page.getValueCount(), bytes, 0);
int offset = rlReader.getNextOffset();
dlReader.initFromPage(page.getValueCount(), bytes, offset);
offset = dlReader.getNextOffset();
return initDataReader(page.getValueEncoding(), bytes, offset, page.getValueCount());
} catch (IOException e) {
throw new ParquetDecodingException("Error reading parquet page " + page + " in column " + columnDescriptor, e);
}
}
Aggregations