MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / upperBound

Method upperBound

src/Storages/MergeTree/MergeTreeIndexText.cpp:96–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96size_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
108DictionarySparseIndex::DictionarySparseIndex(ColumnPtr tokens_, ColumnPtr offsets_in_file_)
109 : DictionaryBlockBase(std::move(tokens_)), offsets_in_file(std::move(offsets_in_file_))

Callers 1

Calls 5

rangeFunction · 0.85
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getDataAtMethod · 0.45

Tested by

no test coverage detected