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

Function ExecInitBitmapAnd

src/backend/executor/nodeBitmapAnd.c:56–106  ·  view source on GitHub ↗

---------------------------------------------------------------- * ExecInitBitmapAnd * * Begin all of the subscans of the BitmapAnd node. * ---------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

54 * ----------------------------------------------------------------
55 */
56BitmapAndState *
57ExecInitBitmapAnd(BitmapAnd *node, EState *estate, int eflags)
58{
59 BitmapAndState *bitmapandstate;
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 bitmapandstate = makeNode(BitmapAndState);
75 bitmapplanstates = (PlanState **) palloc0(nplans * sizeof(PlanState *));
76
77 /*
78 * create new BitmapAndState for our BitmapAnd node
79 */
80 bitmapandstate->ps.plan = (Plan *) node;
81 bitmapandstate->ps.state = estate;
82 bitmapandstate->ps.ExecProcNode = ExecBitmapAnd;
83 bitmapandstate->bitmapplans = bitmapplanstates;
84 bitmapandstate->nplans = nplans;
85
86 /*
87 * call ExecInitNode on each of the plans to be executed and save the
88 * results into the array "bitmapplanstates".
89 */
90 i = 0;
91 foreach(l, node->bitmapplans)
92 {
93 initNode = (Plan *) lfirst(l);
94 bitmapplanstates[i] = ExecInitNode(initNode, estate, eflags);
95 i++;
96 }
97
98 /*
99 * Miscellaneous initialization
100 *
101 * BitmapAnd plans don't have expression contexts because they never call
102 * ExecQual or ExecProject. They don't need any tuple slots either.
103 */
104
105 return bitmapandstate;
106}
107
108/* ----------------------------------------------------------------
109 * MultiExecBitmapAnd

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