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

Function ExecInitRuntimeFilterFinish

src/backend/executor/nodeRuntimeFilter.c:229–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229void
230ExecInitRuntimeFilterFinish(RuntimeFilterState *node, double inner_rows)
231{
232 List *hashops;
233 ListCell *lc;
234 int i = 0;
235
236 hashops = node->hjstate->hj_HashOperators;
237
238 node->value_buf = (Datum *) palloc(hashops->length * sizeof(Datum));
239 node->raw_value = (bool *) palloc(hashops->length * sizeof(bool));
240 node->inner_estimated = (uint64) inner_rows;
241
242 node->bf = bloom_create_aggresive((int64) inner_rows, work_mem, random());
243 if (node->bf == NULL)
244 node->build_suspend = true;
245 /* we can't handle inner table which is bigger than this threshold */
246 node->inner_threshold = bloom_total_bits(node->bf) / 1.6;
247
248 /* init hash function related fields */
249 foreach(lc, hashops)
250 {
251 Oid outer_typ;
252 Oid inner_typ;
253 bool outer_raw;
254 bool inner_raw;
255
256 op_input_types(lfirst_oid(lc), &outer_typ, &inner_typ);
257 outer_raw = IsRawInt8CmpType(outer_typ);
258 inner_raw = IsRawInt8CmpType(inner_typ);
259
260 /* can we directly compare the i-th value as int8? */
261 node->raw_value[i++] = outer_raw && inner_raw;
262 }
263}
264
265void
266ExecEndRuntimeFilter(RuntimeFilterState *node)

Callers 1

ExecInitHashJoinFunction · 0.85

Calls 6

bloom_create_aggresiveFunction · 0.85
randomFunction · 0.85
bloom_total_bitsFunction · 0.85
op_input_typesFunction · 0.85
pallocFunction · 0.50
foreachFunction · 0.50

Tested by

no test coverage detected