MCPcopy Create free account
hub / github.com/apache/cloudberry / findPartialMatch

Function findPartialMatch

src/backend/executor/nodeSubplan.c:728–755  ·  view source on GitHub ↗

* findPartialMatch: does the hashtable contain an entry that is not * provably distinct from the tuple? * * We have to scan the whole hashtable; we can't usefully use hashkeys * to guide probing, since we might get partial matches on tuples with * hashkeys quite unrelated to what we'd get from the given tuple. * * Caller must provide the equality functions to use, since in cross-type * cas

Source from the content-addressed store, hash-verified

726 * cases these are different from the hashtable's internal functions.
727 */
728static bool
729findPartialMatch(TupleHashTable hashtable, TupleTableSlot *slot,
730 FmgrInfo *eqfunctions)
731{
732 int numCols = hashtable->numCols;
733 AttrNumber *keyColIdx = hashtable->keyColIdx;
734 TupleHashIterator hashiter;
735 TupleHashEntry entry;
736
737 InitTupleHashIterator(hashtable, &hashiter);
738 while ((entry = ScanTupleHashTable(hashtable, &hashiter)) != NULL)
739 {
740 CHECK_FOR_INTERRUPTS();
741
742 ExecStoreMinimalTuple(entry->firstTuple, hashtable->tableslot, false);
743 if (!execTuplesUnequal(slot, hashtable->tableslot,
744 numCols, keyColIdx,
745 eqfunctions,
746 hashtable->tab_collations,
747 hashtable->tempcxt))
748 {
749 TermTupleHashIterator(&hashiter);
750 return true;
751 }
752 }
753 /* No TermTupleHashIterator call needed here */
754 return false;
755}
756
757/*
758 * slotAllNulls: is the slot completely NULL?

Callers 1

ExecHashSubPlanFunction · 0.85

Calls 2

ExecStoreMinimalTupleFunction · 0.85
execTuplesUnequalFunction · 0.85

Tested by

no test coverage detected