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

Function ExecParallelHashTableAlloc

src/backend/executor/nodeHash.c:3813–3827  ·  view source on GitHub ↗

* Allocate an empty shared memory hash table for a given batch. */

Source from the content-addressed store, hash-verified

3811 * Allocate an empty shared memory hash table for a given batch.
3812 */
3813void
3814ExecParallelHashTableAlloc(HashJoinTable hashtable, int batchno)
3815{
3816 ParallelHashJoinBatch *batch = hashtable->batches[batchno].shared;
3817 dsa_pointer_atomic *buckets;
3818 int nbuckets = hashtable->parallel_state->nbuckets;
3819 int i;
3820
3821 batch->buckets =
3822 dsa_allocate(hashtable->area, sizeof(dsa_pointer_atomic) * nbuckets);
3823 buckets = (dsa_pointer_atomic *)
3824 dsa_get_address(hashtable->area, batch->buckets);
3825 for (i = 0; i < nbuckets; ++i)
3826 dsa_pointer_atomic_init(&buckets[i], InvalidDsaPointer);
3827}
3828
3829/*
3830 * If we are currently attached to a shared hash join batch, detach. If we

Callers 2

ExecHashTableCreateFunction · 0.85

Calls 1

dsa_get_addressFunction · 0.85

Tested by

no test coverage detected