| 281 | } |
| 282 | |
| 283 | uint32_t HashTableCtx::HashVariableLenRow(const uint8_t* expr_values, |
| 284 | const uint8_t* expr_values_null) const { |
| 285 | uint32_t hash = seeds_[level_]; |
| 286 | int var_result_offset = expr_values_cache_.var_result_offset(); |
| 287 | // Hash the non-var length portions (if there are any) |
| 288 | if (var_result_offset != 0) { |
| 289 | hash = Hash(expr_values, var_result_offset, hash); |
| 290 | } |
| 291 | |
| 292 | for (int i = 0; i < build_exprs_.size(); ++i) { |
| 293 | // non-string and null slots are already part of 'expr_values'. |
| 294 | if (build_exprs_[i]->type().type != TYPE_STRING && |
| 295 | build_exprs_[i]->type().type != TYPE_VARCHAR) { |
| 296 | continue; |
| 297 | } |
| 298 | const void* loc = expr_values_cache_.ExprValuePtr(expr_values, i); |
| 299 | if (expr_values_null[i]) { |
| 300 | // Hash the null random seed values at 'loc' |
| 301 | hash = Hash(loc, sizeof(StringValue), hash); |
| 302 | } else { |
| 303 | // Hash the string |
| 304 | // TODO: when using CRC hash on empty string, this only swaps bytes. |
| 305 | const StringValue* str = reinterpret_cast<const StringValue*>(loc); |
| 306 | hash = Hash(str->Ptr(), str->Len(), hash); |
| 307 | } |
| 308 | } |
| 309 | return hash; |
| 310 | } |
| 311 | |
| 312 | template <bool INCLUSIVE_EQUALITY> |
| 313 | bool HashTableCtx::Equals(const TupleRow* build_row, const uint8_t* expr_values, |
nothing calls this directly
no test coverage detected