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

Function execTuplesHashPrepare

src/backend/executor/execGrouping.c:97–125  ·  view source on GitHub ↗

* execTuplesHashPrepare * Look up the equality and hashing functions needed for a TupleHashTable. * * This is similar to execTuplesMatchPrepare, but we also need to find the * hash functions associated with the equality operators. *eqFunctions and * *hashFunctions receive the palloc'd result arrays. * * Note: we expect that the given operators are not cross-type comparisons. */

Source from the content-addressed store, hash-verified

95 * Note: we expect that the given operators are not cross-type comparisons.
96 */
97void
98execTuplesHashPrepare(int numCols,
99 const Oid *eqOperators,
100 Oid **eqFuncOids,
101 FmgrInfo **hashFunctions)
102{
103 int i;
104
105 *eqFuncOids = (Oid *) palloc(numCols * sizeof(Oid));
106 *hashFunctions = (FmgrInfo *) palloc(numCols * sizeof(FmgrInfo));
107
108 for (i = 0; i < numCols; i++)
109 {
110 Oid eq_opr = eqOperators[i];
111 Oid eq_function;
112 Oid left_hash_function;
113 Oid right_hash_function;
114
115 eq_function = get_opcode(eq_opr);
116 if (!get_op_hash_functions(eq_opr,
117 &left_hash_function, &right_hash_function))
118 elog(ERROR, "could not find hash function for hash operator %u",
119 eq_opr);
120 /* We're not supporting cross-type cases here */
121 Assert(left_hash_function == right_hash_function);
122 (*eqFuncOids)[i] = eq_function;
123 fmgr_info(right_hash_function, &(*hashFunctions)[i]);
124 }
125}
126
127
128/*****************************************************************************

Callers 3

ExecInitSetOpFunction · 0.85
ExecInitRecursiveUnionFunction · 0.85
find_hash_columnsFunction · 0.85

Calls 4

get_opcodeFunction · 0.85
get_op_hash_functionsFunction · 0.85
fmgr_infoFunction · 0.85
pallocFunction · 0.50

Tested by

no test coverage detected