| 200 | |
| 201 | template <DictionaryKeyType dictionary_key_type, bool sharded> |
| 202 | ColumnUInt8::Ptr HashedArrayDictionary<dictionary_key_type, sharded>::hasKeys(const Columns & key_columns, const DataTypes & key_types) const |
| 203 | { |
| 204 | if (dictionary_key_type == DictionaryKeyType::Complex) |
| 205 | dict_struct.validateKeyTypes(key_types); |
| 206 | |
| 207 | DictionaryKeysArenaHolder<dictionary_key_type> arena_holder; |
| 208 | DictionaryKeysExtractor<dictionary_key_type> extractor(key_columns, arena_holder.getComplexKeyArena()); |
| 209 | |
| 210 | size_t keys_size = extractor.getKeysSize(); |
| 211 | |
| 212 | auto result = ColumnUInt8::create(keys_size, false); |
| 213 | auto & out = result->getData(); |
| 214 | |
| 215 | size_t keys_found = 0; |
| 216 | |
| 217 | for (size_t requested_key_index = 0; requested_key_index < keys_size; ++requested_key_index) |
| 218 | { |
| 219 | auto requested_key = extractor.extractCurrentKey(); |
| 220 | auto shard = getShard(requested_key); |
| 221 | const auto & key_attribute_container = key_attribute.containers[shard]; |
| 222 | |
| 223 | out[requested_key_index] = key_attribute_container.find(requested_key) != key_attribute_container.end(); |
| 224 | |
| 225 | keys_found += out[requested_key_index]; |
| 226 | extractor.rollbackCurrentKey(); |
| 227 | } |
| 228 | |
| 229 | query_count.fetch_add(keys_size, std::memory_order_relaxed); |
| 230 | found_count.fetch_add(keys_found, std::memory_order_relaxed); |
| 231 | |
| 232 | return result; |
| 233 | } |
| 234 | |
| 235 | template <DictionaryKeyType dictionary_key_type, bool sharded> |
| 236 | ColumnPtr HashedArrayDictionary<dictionary_key_type, sharded>::getHierarchy(ColumnPtr key_column [[maybe_unused]], const DataTypePtr &) const |
nothing calls this directly
no test coverage detected