MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / matchFlatVecWithEntry

Method matchFlatVecWithEntry

src/processor/result/base_hash_table.cpp:263–285  ·  view source on GitHub ↗

! This function will only be used by distinct aggregate and hashJoin, which assumes that all keyVectors are flat.

Source from the content-addressed store, hash-verified

261// ! This function will only be used by distinct aggregate and hashJoin, which assumes that all
262// keyVectors are flat.
263bool 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
287void BaseHashTable::initCompareFuncs() {
288 compareEntryFuncs.reserve(keyTypes.size());

Callers

nothing calls this directly

Calls 6

getTableSchemaFunction · 0.85
getSelSizeMethod · 0.80
isNonOverflowColNullMethod · 0.80
sizeMethod · 0.45
isFlatMethod · 0.45
isNullMethod · 0.45

Tested by

no test coverage detected