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

Function MultiExecPrivateHash

src/backend/executor/nodeHash.c:166–256  ·  view source on GitHub ↗

---------------------------------------------------------------- * MultiExecPrivateHash * * parallel-oblivious version, building a backend-private * hash table and (if necessary) batch files. * ---------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

164 * ----------------------------------------------------------------
165 */
166static void
167MultiExecPrivateHash(HashState *node)
168{
169 PlanState *outerNode;
170 List *hashkeys;
171 HashJoinTable hashtable;
172 TupleTableSlot *slot;
173 ExprContext *econtext;
174 uint32 hashvalue;
175
176 /*
177 * get state info from node
178 */
179 outerNode = outerPlanState(node);
180 hashtable = node->hashtable;
181
182 /*
183 * set expression context
184 */
185 hashkeys = node->hashkeys;
186 econtext = node->ps.ps_ExprContext;
187
188 SIMPLE_FAULT_INJECTOR("multi_exec_hash_large_vmem");
189
190 /*
191 * Get all tuples from the node below the Hash node and insert into the
192 * hash table (or temp files).
193 */
194 for (;;)
195 {
196 slot = ExecProcNode(outerNode);
197 if (TupIsNull(slot))
198 {
199 if (gp_enable_runtime_filter_pushdown && node->filters)
200 PushdownRuntimeFilter(node);
201 break;
202 }
203
204 if (gp_enable_runtime_filter_pushdown && node->filters)
205 AddTupleValuesIntoRF(node, slot);
206
207 /* We have to compute the hash value */
208 econtext->ecxt_outertuple = slot;
209 bool hashkeys_null = false;
210 if (ExecHashGetHashValue(node, hashtable, econtext, hashkeys,
211 false, hashtable->keepNulls,
212 &hashvalue, &hashkeys_null))
213 {
214 int bucketNumber;
215
216 bucketNumber = ExecHashGetSkewBucket(hashtable, hashvalue);
217 if (bucketNumber != INVALID_SKEW_BUCKET_NO)
218 {
219 /* It's a skew tuple, so put it into that hash table */
220 ExecHashSkewTableInsert(node, hashtable, slot, hashvalue,
221 bucketNumber);
222 hashtable->skewTuples += 1;
223 }

Callers 1

MultiExecHashFunction · 0.85

Calls 9

ExecProcNodeFunction · 0.85
PushdownRuntimeFilterFunction · 0.85
AddTupleValuesIntoRFFunction · 0.85
ExecHashGetHashValueFunction · 0.85
ExecHashGetSkewBucketFunction · 0.85
ExecHashSkewTableInsertFunction · 0.85
ExecHashTableInsertFunction · 0.85
ExecSquelchNodeFunction · 0.85

Tested by

no test coverage detected