use of com.facebook.presto.orc.metadata.ColumnEncoding.ColumnEncodingKind.DICTIONARY in project presto by prestodb.
the class StripeReader method addIncludedStreams.
/**
* Add streams that are in includedOrcColumns to the includedStreams map,
* and return whether there were any rowGroupDictionaries
*/
private boolean addIncludedStreams(Map<Integer, ColumnEncoding> columnEncodings, List<Stream> streams, Map<StreamId, Stream> includedStreams) {
boolean hasRowGroupDictionary = false;
for (Stream stream : streams) {
if (includedOrcColumns.contains(stream.getColumn())) {
includedStreams.put(new StreamId(stream), stream);
if (stream.getStreamKind() == StreamKind.IN_DICTIONARY) {
ColumnEncoding columnEncoding = columnEncodings.get(stream.getColumn());
if (columnEncoding.getColumnEncodingKind() == DICTIONARY) {
hasRowGroupDictionary = true;
}
Optional<SortedMap<Integer, DwrfSequenceEncoding>> additionalSequenceEncodings = columnEncoding.getAdditionalSequenceEncodings();
if (additionalSequenceEncodings.isPresent() && additionalSequenceEncodings.get().values().stream().map(DwrfSequenceEncoding::getValueEncoding).anyMatch(encoding -> encoding.getColumnEncodingKind() == DICTIONARY)) {
hasRowGroupDictionary = true;
}
}
}
}
return hasRowGroupDictionary;
}
Aggregations