| 94 | } |
| 95 | |
| 96 | size_t DictionaryBlockBase::upperBound(std::string_view token) const |
| 97 | { |
| 98 | auto range = collections::range(0, tokens->size()); |
| 99 | |
| 100 | auto it = std::upper_bound(range.begin(), range.end(), token, [this](std::string_view lhs_ref, size_t rhs_idx) |
| 101 | { |
| 102 | return lhs_ref < assert_cast<const ColumnString &>(*tokens).getDataAt(rhs_idx); |
| 103 | }); |
| 104 | |
| 105 | return it - range.begin(); |
| 106 | } |
| 107 | |
| 108 | DictionarySparseIndex::DictionarySparseIndex(ColumnPtr tokens_, ColumnPtr offsets_in_file_) |
| 109 | : DictionaryBlockBase(std::move(tokens_)), offsets_in_file(std::move(offsets_in_file_)) |