! This function will only be used by distinct aggregate and hashJoin, which assumes that all keyVectors are flat.
| 261 | // ! This function will only be used by distinct aggregate and hashJoin, which assumes that all |
| 262 | // keyVectors are flat. |
| 263 | bool BaseHashTable::matchFlatVecWithEntry(const std::vector<common::ValueVector*>& keyVectors, |
| 264 | const uint8_t* entry) { |
| 265 | for (auto i = 0u; i < keyVectors.size(); i++) { |
| 266 | auto keyVector = keyVectors[i]; |
| 267 | DASSERT(keyVector->state->isFlat()); |
| 268 | DASSERT(keyVector->state->getSelVector().getSelSize() == 1); |
| 269 | auto pos = keyVector->state->getSelVector()[0]; |
| 270 | auto isKeyVectorNull = keyVector->isNull(pos); |
| 271 | auto isEntryKeyNull = |
| 272 | factorizedTable->isNonOverflowColNull(entry + getTableSchema()->getNullMapOffset(), i); |
| 273 | // If either key or entry is null, we shouldn't compare the value of keyVector and |
| 274 | // entry. |
| 275 | if (isKeyVectorNull && isEntryKeyNull) { |
| 276 | continue; |
| 277 | } else if (isKeyVectorNull != isEntryKeyNull) { |
| 278 | return false; |
| 279 | } |
| 280 | if (!compareEntryFuncs[i](keyVector, pos, entry + getTableSchema()->getColOffset(i))) { |
| 281 | return false; |
| 282 | } |
| 283 | } |
| 284 | return true; |
| 285 | } |
| 286 | |
| 287 | void BaseHashTable::initCompareFuncs() { |
| 288 | compareEntryFuncs.reserve(keyTypes.size()); |
nothing calls this directly
no test coverage detected