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

Function ExecInitExpr

src/backend/executor/execExpr.c:134–163  ·  view source on GitHub ↗

* ExecInitExpr: prepare an expression tree for execution * * This function builds and returns an ExprState implementing the given * Expr node tree. The return ExprState can then be handed to ExecEvalExpr * for execution. Because the Expr tree itself is read-only as far as * ExecInitExpr and ExecEvalExpr are concerned, several different executions * of the same plan tree can occur concurren

Source from the content-addressed store, hash-verified

132 * although ExecQual and ExecCheck will accept one (and treat it as "true").
133 */
134ExprState *
135ExecInitExpr(Expr *node, PlanState *parent)
136{
137 ExprState *state;
138 ExprEvalStep scratch = {0};
139
140 /* Special case: NULL expression produces a NULL ExprState pointer */
141 if (node == NULL)
142 return NULL;
143
144 /* Initialize ExprState with empty step list */
145 state = makeNode(ExprState);
146 state->expr = node;
147 state->parent = parent;
148 state->ext_params = NULL;
149
150 /* Insert EEOP_*_FETCHSOME steps as needed */
151 ExecInitExprSlots(state, (Node *) node);
152
153 /* Compile the expression proper */
154 ExecInitExprRec(node, state, &state->resvalue, &state->resnull);
155
156 /* Finally, append a DONE step */
157 scratch.opcode = EEOP_DONE;
158 ExprEvalPushStep(state, &scratch);
159
160 ExecReadyExpr(state);
161
162 return state;
163}
164
165/*
166 * ExecInitExprWithParams: prepare a standalone expression tree for execution

Callers 15

get_cast_hashentryFunction · 0.85
prep_domain_constraintsFunction · 0.85
BeginCopyFromFunction · 0.85
ATRewriteTableFunction · 0.85
slot_fill_defaultsFunction · 0.85
MakeTidOpExprFunction · 0.85
MJExamineQualsFunction · 0.85
ExecInitWindowAggFunction · 0.85
ExecInitProjectSetFunction · 0.85
ExecInitMemoizeFunction · 0.85
ExecInitTupleSplitFunction · 0.85
ExecInitSampleScanFunction · 0.85

Calls 4

ExecInitExprSlotsFunction · 0.85
ExecInitExprRecFunction · 0.85
ExprEvalPushStepFunction · 0.85
ExecReadyExprFunction · 0.85

Tested by 1

operator_predicate_proofFunction · 0.68