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

Function ExecInitBitmapOr

src/backend/executor/nodeBitmapOr.c:56–105  ·  view source on GitHub ↗

---------------------------------------------------------------- * ExecInitBitmapOr * * Begin all of the subscans of the BitmapOr node. * ---------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

54 * ----------------------------------------------------------------
55 */
56BitmapOrState *
57ExecInitBitmapOr(BitmapOr *node, EState *estate, int eflags)
58{
59 BitmapOrState *bitmaporstate = makeNode(BitmapOrState);
60 PlanState **bitmapplanstates;
61 int nplans;
62 int i;
63 ListCell *l;
64 Plan *initNode;
65
66 /* check for unsupported flags */
67 Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)));
68
69 /*
70 * Set up empty vector of subplan states
71 */
72 nplans = list_length(node->bitmapplans);
73
74 bitmapplanstates = (PlanState **) palloc0(nplans * sizeof(PlanState *));
75
76 /*
77 * create new BitmapOrState for our BitmapOr node
78 */
79 bitmaporstate->ps.plan = (Plan *) node;
80 bitmaporstate->ps.state = estate;
81 bitmaporstate->ps.ExecProcNode = ExecBitmapOr;
82 bitmaporstate->bitmapplans = bitmapplanstates;
83 bitmaporstate->nplans = nplans;
84
85 /*
86 * call ExecInitNode on each of the plans to be executed and save the
87 * results into the array "bitmapplanstates".
88 */
89 i = 0;
90 foreach(l, node->bitmapplans)
91 {
92 initNode = (Plan *) lfirst(l);
93 bitmapplanstates[i] = ExecInitNode(initNode, estate, eflags);
94 i++;
95 }
96
97 /*
98 * Miscellaneous initialization
99 *
100 * BitmapOr plans don't have expression contexts because they never call
101 * ExecQual or ExecProject. They don't need any tuple slots either.
102 */
103
104 return bitmaporstate;
105}
106
107/* ----------------------------------------------------------------
108 * MultiExecBitmapOr

Callers 1

ExecInitNodeFunction · 0.85

Calls 4

list_lengthFunction · 0.85
ExecInitNodeFunction · 0.85
palloc0Function · 0.50
foreachFunction · 0.50

Tested by

no test coverage detected