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

Function FindTupleHashEntry

src/backend/executor/execGrouping.c:403–426  ·  view source on GitHub ↗

* Search for a hashtable entry matching the given tuple. No entry is * created if there's not a match. This is similar to the non-creating * case of LookupTupleHashEntry, except that it supports cross-type * comparisons, in which the given tuple is not of the same type as the * table entries. The caller must provide the hash functions to use for * the input tuple, as well as the equality f

Source from the content-addressed store, hash-verified

401 * different from the table's internal functions.
402 */
403TupleHashEntry
404FindTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot,
405 ExprState *eqcomp,
406 FmgrInfo *hashfunctions)
407{
408 TupleHashEntry entry;
409 MemoryContext oldContext;
410 MinimalTuple key;
411
412 /* Need to run the hash functions in short-lived context */
413 oldContext = MemoryContextSwitchTo(hashtable->tempcxt);
414
415 /* Set up data needed by hash and match functions */
416 hashtable->inputslot = slot;
417 hashtable->in_hash_funcs = hashfunctions;
418 hashtable->cur_eq_func = eqcomp;
419
420 /* Search the hash table */
421 key = NULL; /* flag to reference inputslot */
422 entry = tuplehash_lookup(hashtable->hashtab, key);
423 MemoryContextSwitchTo(oldContext);
424
425 return entry;
426}
427
428/*
429 * If tuple is NULL, use the input slot instead. This convention avoids the

Callers 1

ExecHashSubPlanFunction · 0.85

Calls 1

MemoryContextSwitchToFunction · 0.85

Tested by

no test coverage detected