use of com.facebook.presto.parquet.DictionaryPage in project presto by prestodb.
the class AbstractColumnReader method init.
@Override
public void init(PageReader pageReader, Field field, RowRanges rowRanges) {
this.pageReader = requireNonNull(pageReader, "pageReader is null");
this.field = requireNonNull(field, "field is null");
DictionaryPage dictionaryPage = pageReader.readDictionaryPage();
if (dictionaryPage != null) {
try {
dictionary = dictionaryPage.getEncoding().initDictionary(columnDescriptor, dictionaryPage);
} catch (IOException e) {
throw new ParquetDecodingException("could not decode the dictionary for " + columnDescriptor, e);
}
} else {
dictionary = null;
}
checkArgument(pageReader.getTotalValueCount() > 0, "page is empty");
totalValueCount = pageReader.getTotalValueCount();
indexIterator = (rowRanges == null) ? null : rowRanges.iterator();
}
Aggregations