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

Function ExecInitGroup

src/backend/executor/nodeGroup.c:161–219  ·  view source on GitHub ↗

----------------- * ExecInitGroup * * Creates the run-time information for the group node produced by the * planner and initializes its outer subtree * ----------------- */

Source from the content-addressed store, hash-verified

159 * -----------------
160 */
161GroupState *
162ExecInitGroup(Group *node, EState *estate, int eflags)
163{
164 GroupState *grpstate;
165 const TupleTableSlotOps *tts_ops;
166
167 /* check for unsupported flags */
168 Assert(!(eflags & (EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK)));
169
170 /*
171 * create state structure
172 */
173 grpstate = makeNode(GroupState);
174 grpstate->ss.ps.plan = (Plan *) node;
175 grpstate->ss.ps.state = estate;
176 grpstate->ss.ps.ExecProcNode = ExecGroup;
177 grpstate->grp_done = false;
178
179 /*
180 * create expression context
181 */
182 ExecAssignExprContext(estate, &grpstate->ss.ps);
183
184 /*
185 * initialize child nodes
186 */
187 outerPlanState(grpstate) = ExecInitNode(outerPlan(node), estate, eflags);
188
189 /*
190 * Initialize scan slot and type.
191 */
192 tts_ops = ExecGetResultSlotOps(outerPlanState(&grpstate->ss), NULL);
193 ExecCreateScanSlotFromOuterPlan(estate, &grpstate->ss, tts_ops);
194
195 /*
196 * Initialize result slot, type and projection.
197 */
198 ExecInitResultTupleSlotTL(&grpstate->ss.ps, &TTSOpsVirtual);
199 ExecAssignProjectionInfo(&grpstate->ss.ps, NULL);
200
201 /*
202 * initialize child expressions
203 */
204 grpstate->ss.ps.qual =
205 ExecInitQual(node->plan.qual, (PlanState *) grpstate);
206
207 /*
208 * Precompute fmgr lookup data for inner loop
209 */
210 grpstate->eqfunction =
211 execTuplesMatchPrepare(ExecGetResultType(outerPlanState(grpstate)),
212 node->numCols,
213 node->grpColIdx,
214 node->grpOperators,
215 node->grpCollations,
216 &grpstate->ss.ps);
217
218 return grpstate;

Callers 1

ExecInitNodeFunction · 0.85

Calls 9

ExecAssignExprContextFunction · 0.85
ExecInitNodeFunction · 0.85
ExecGetResultSlotOpsFunction · 0.85
ExecAssignProjectionInfoFunction · 0.85
ExecInitQualFunction · 0.85
execTuplesMatchPrepareFunction · 0.85
ExecGetResultTypeFunction · 0.85

Tested by

no test coverage detected