in velox/dwio/dwrf/reader/ColumnVisitors.h [607:659]
FOLLY_ALWAYS_INLINE vector_size_t process(T value, bool& atEnd) {
if (!isInDict()) {
// If reading fixed width values, the not in dictionary value will be read
// as unsigned at the width of the type. Integer columns are signed, so
// sign extend the value here.
if (LIKELY(width_ == 8)) {
// No action. This should be the most common case.
} else if (width_ == 4) {
value = static_cast<int32_t>(value);
} else {
value = static_cast<int16_t>(value);
}
return super::process(value, atEnd);
}
vector_size_t previous =
isDense && TFilter::deterministic ? 0 : super::currentRow();
T valueInDictionary = dict_[value];
if (std::is_same<TFilter, common::AlwaysTrue>::value) {
super::filterPassed(valueInDictionary);
} else {
// check the dictionary cache
if (TFilter::deterministic &&
filterCache_[value] == FilterResult::kSuccess) {
super::filterPassed(valueInDictionary);
} else if (
TFilter::deterministic &&
filterCache_[value] == FilterResult::kFailure) {
super::filterFailed();
} else {
if (super::filter_.testInt64(valueInDictionary)) {
super::filterPassed(valueInDictionary);
if (TFilter::deterministic) {
filterCache_[value] = FilterResult::kSuccess;
}
} else {
super::filterFailed();
if (TFilter::deterministic) {
filterCache_[value] = FilterResult::kFailure;
}
}
}
}
if (++super::rowIndex_ >= super::numRows_) {
atEnd = true;
return (isDense && TFilter::deterministic)
? 0
: super::rowAt(super::numRows_ - 1) - previous;
}
if (isDense && TFilter::deterministic) {
return 0;
}
return super::currentRow() - previous - 1;
}