Search in sources :

Example 1 with ValuesReader

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);
    }
}
Also used : ValuesReader(parquet.column.values.ValuesReader) ParquetDecodingException(parquet.io.ParquetDecodingException) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 ValuesReader (parquet.column.values.ValuesReader)1 ParquetDecodingException (parquet.io.ParquetDecodingException)1