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

Function ExecInitRuntimeFilter

src/backend/executor/nodeRuntimeFilter.c:145–209  ·  view source on GitHub ↗

---------------------------------------------------------------- * ExecInitRuntimeFilter * ---------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

143 * ----------------------------------------------------------------
144 */
145RuntimeFilterState *
146ExecInitRuntimeFilter(RuntimeFilter *node, EState *estate, int eflags)
147{
148 RuntimeFilterState *rfstate;
149 Plan *outerPlan;
150
151 /*
152 * create state structure
153 */
154 rfstate = makeNode(RuntimeFilterState);
155 rfstate->ps.plan = (Plan *) node;
156 rfstate->ps.state = estate;
157 rfstate->ps.ExecProcNode = ExecRuntimeFilter;
158
159 rfstate->build_finish = false;
160 rfstate->build_suspend = false;
161 rfstate->inner_processed = 0;
162
163 /* will setup later*/
164 rfstate->inner_estimated = 0;
165 rfstate->inner_threshold = 0;
166 rfstate->value_buf = NULL;
167 rfstate->raw_value = NULL;
168 rfstate->bf = NULL;
169
170 /* CDB: Offer extra info for EXPLAIN ANALYZE. */
171 if (estate->es_instrument && (estate->es_instrument & INSTRUMENT_CDB))
172 {
173 /* Allocate string buffer. */
174 rfstate->ps.cdbexplainbuf = makeStringInfo();
175
176 /* Request a callback at end of query. */
177 rfstate->ps.cdbexplainfun = ExecRuntimeFilterExplainEnd;
178 }
179
180 /*
181 * Miscellaneous initialization
182 *
183 * create expression context for node
184 */
185 ExecAssignExprContext(estate, &rfstate->ps);
186
187 /*
188 * initialize outer plan
189 */
190 outerPlan = outerPlan(node);
191 outerPlanState(rfstate) = ExecInitNode(outerPlan, estate, eflags);
192
193 /*
194 * Initialize result type
195 */
196 ExecInitResultTypeTL(&rfstate->ps);
197
198 rfstate->ps.resultopsset = true;
199 rfstate->ps.resultops = ExecGetResultSlotOps(outerPlanState(rfstate),
200 &rfstate->ps.resultopsfixed);
201
202 /*

Callers 1

ExecInitNodeFunction · 0.85

Calls 5

makeStringInfoFunction · 0.85
ExecAssignExprContextFunction · 0.85
ExecInitNodeFunction · 0.85
ExecInitResultTypeTLFunction · 0.85
ExecGetResultSlotOpsFunction · 0.85

Tested by

no test coverage detected