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

Function datumHashTableHash

src/backend/commands/analyzeutils.c:470–481  ·  view source on GitHub ↗

* Hash function for MCVFreqPair struct pointer. * Input: * keyPtr - pointer to hash key * keysize - not used, hash function must have this signature * Output: * result - hash value as an unsigned integer */

Source from the content-addressed store, hash-verified

468 * result - hash value as an unsigned integer
469 */
470static uint32
471datumHashTableHash(const void *keyPtr, Size keysize)
472{
473 uint32 result;
474 MCVFreqPair *mcvFreqPair = *((MCVFreqPair **)keyPtr);
475 FmgrInfo *hashfunc = &mcvFreqPair->typinfo->hashfunc;
476 Oid collid = mcvFreqPair->typinfo->collid;
477
478 result = DatumGetUInt32(FunctionCall1Coll(hashfunc, collid, mcvFreqPair->mcv));
479
480 return result;
481}
482
483/**
484 * Match function for MCVFreqPair struct pointer.

Callers

nothing calls this directly

Calls 2

DatumGetUInt32Function · 0.85
FunctionCall1CollFunction · 0.85

Tested by

no test coverage detected