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

Function ExecInitResult

src/backend/executor/nodeResult.c:247–318  ·  view source on GitHub ↗

---------------------------------------------------------------- * ExecInitResult * * Creates the run-time state information for the result node * produced by the planner and initializes outer relations * (child nodes). * ---------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

245 * ----------------------------------------------------------------
246 */
247ResultState *
248ExecInitResult(Result *node, EState *estate, int eflags)
249{
250 ResultState *resstate;
251
252 /* check for unsupported flags */
253 Assert(!(eflags & (EXEC_FLAG_MARK | EXEC_FLAG_BACKWARD)) ||
254 outerPlan(node) != NULL);
255
256 /*
257 * create state structure
258 */
259 resstate = makeNode(ResultState);
260 resstate->ps.plan = (Plan *) node;
261 resstate->ps.state = estate;
262 resstate->ps.ExecProcNode = ExecResult;
263
264 resstate->rs_done = false;
265 resstate->rs_checkqual = (node->resconstantqual == NULL) ? false : true;
266
267 /*
268 * Miscellaneous initialization
269 *
270 * create expression context for node
271 */
272 ExecAssignExprContext(estate, &resstate->ps);
273
274 /*
275 * initialize child nodes
276 */
277 outerPlanState(resstate) = ExecInitNode(outerPlan(node), estate, eflags);
278
279 /*
280 * we don't use inner plan
281 */
282 Assert(innerPlan(node) == NULL);
283
284 /*
285 * Initialize result slot, type and projection.
286 */
287 ExecInitResultTupleSlotTL(&resstate->ps, &TTSOpsVirtual);
288 ExecAssignProjectionInfo(&resstate->ps, NULL);
289
290 /*
291 * initialize child expressions
292 */
293 resstate->ps.qual =
294 ExecInitQual(node->plan.qual, (PlanState *) resstate);
295 resstate->resconstantqual =
296 ExecInitQual((List *) node->resconstantqual, (PlanState *) resstate);
297
298 /*
299 * initialize hash filter
300 */
301 if (node->numHashFilterCols > 0)
302 {
303 int currentSliceId = estate->currentSliceId;
304 ExecSlice *currentSlice = &estate->es_sliceTable->slices[currentSliceId];

Callers 1

ExecInitNodeFunction · 0.85

Calls 8

ExecAssignExprContextFunction · 0.85
ExecInitNodeFunction · 0.85
ExecAssignProjectionInfoFunction · 0.85
ExecInitQualFunction · 0.85
makeCdbHashFunction · 0.85
IsResultMemoryIntensiveFunction · 0.85
SPI_ReserveMemoryFunction · 0.85

Tested by

no test coverage detected