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

Function ExecInitHash

src/backend/executor/nodeHash.c:456–503  ·  view source on GitHub ↗

---------------------------------------------------------------- * ExecInitHash * * Init routine for Hash node * ---------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

454 * ----------------------------------------------------------------
455 */
456HashState *
457ExecInitHash(Hash *node, EState *estate, int eflags)
458{
459 HashState *hashstate;
460
461 /* check for unsupported flags */
462 Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)));
463
464 /*
465 * create state structure
466 */
467 hashstate = makeNode(HashState);
468 hashstate->ps.plan = (Plan *) node;
469 hashstate->ps.state = estate;
470 hashstate->ps.ExecProcNode = ExecHash;
471 hashstate->hashtable = NULL;
472 hashstate->hashkeys = NIL; /* will be set by parent HashJoin */
473
474 hashstate->rfstate = NULL;
475
476 /*
477 * Miscellaneous initialization
478 *
479 * create expression context for node
480 */
481 ExecAssignExprContext(estate, &hashstate->ps);
482
483 /*
484 * initialize child nodes
485 */
486 outerPlanState(hashstate) = ExecInitNode(outerPlan(node), estate, eflags);
487
488 /*
489 * initialize our result slot and type. No need to build projection
490 * because this node doesn't do projections.
491 */
492 ExecInitResultTupleSlotTL(&hashstate->ps, &TTSOpsMinimalTuple);
493 hashstate->ps.ps_ProjInfo = NULL;
494
495 /*
496 * initialize child expressions
497 */
498 Assert(node->plan.qual == NIL);
499 hashstate->hashkeys =
500 ExecInitExprList(node->hashkeys, (PlanState *) hashstate);
501
502 return hashstate;
503}
504
505/* ---------------------------------------------------------------
506 * ExecEndHash

Callers 1

ExecInitNodeFunction · 0.85

Calls 4

ExecAssignExprContextFunction · 0.85
ExecInitNodeFunction · 0.85
ExecInitExprListFunction · 0.85

Tested by

no test coverage detected