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

Method getHash

src/Storages/MergeTree/MergeTreeIndexConditionText.cpp:65–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65SipHash TextSearchQuery::getHash() const
66{
67 SipHash hash;
68 hash.update(function_name);
69 hash.update(search_mode);
70 hash.update(direct_read_mode);
71
72 hash.update(tokens.size());
73 for (const auto & token : tokens)
74 {
75 hash.update(token.size());
76 hash.update(token);
77 }
78
79 if (!patterns.empty())
80 {
81 hash.update(patterns.size());
82 for (const auto & pattern : patterns)
83 {
84 if (const auto & re2 = pattern.getRE2())
85 {
86 hash.update(re2->pattern());
87 }
88 else
89 {
90 std::string required_substring;
91 bool is_trivial = false;
92 bool required_substring_is_prefix = false;
93 pattern.getAnalyzeResult(required_substring, is_trivial, required_substring_is_prefix);
94 hash.update(required_substring);
95 hash.update(is_trivial);
96 hash.update(required_substring_is_prefix);
97 }
98 }
99 }
100
101 return hash;
102}
103
104MergeTreeIndexConditionText::MergeTreeIndexConditionText(
105 const ActionsDAG::Node * predicate,

Callers 15

startMutationMethod · 0.45
fillDataMethod · 0.45
checkDataPartFunction · 0.45
readMethod · 0.45
storeMethod · 0.45
addToChecksumsMethod · 0.45

Calls 4

getAnalyzeResultMethod · 0.80
updateMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected