| 63 | } |
| 64 | |
| 65 | SipHash 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 | |
| 104 | MergeTreeIndexConditionText::MergeTreeIndexConditionText( |
| 105 | const ActionsDAG::Node * predicate, |
no test coverage detected