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

Function ExecSetOp

src/backend/executor/nodeSetOp.c:189–221  ·  view source on GitHub ↗

---------------------------------------------------------------- * ExecSetOp * ---------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

187 * ----------------------------------------------------------------
188 */
189static TupleTableSlot * /* return: a tuple or NULL */
190ExecSetOp(PlanState *pstate)
191{
192 SetOpState *node = castNode(SetOpState, pstate);
193 SetOp *plannode = (SetOp *) node->ps.plan;
194 TupleTableSlot *resultTupleSlot = node->ps.ps_ResultTupleSlot;
195
196 CHECK_FOR_INTERRUPTS();
197
198 /*
199 * If the previously-returned tuple needs to be returned more than once,
200 * keep returning it.
201 */
202 if (node->numOutput > 0)
203 {
204 node->numOutput--;
205 return resultTupleSlot;
206 }
207
208 /* Otherwise, we're done if we are out of groups */
209 if (node->setop_done)
210 return NULL;
211
212 /* Fetch the next tuple group according to the correct strategy */
213 if (plannode->strategy == SETOP_HASHED)
214 {
215 if (!node->table_filled)
216 setop_fill_hash_table(node);
217 return setop_retrieve_hash_table(node);
218 }
219 else
220 return setop_retrieve_direct(node);
221}
222
223/*
224 * ExecSetOp for non-hashed case

Callers

nothing calls this directly

Calls 3

setop_fill_hash_tableFunction · 0.85
setop_retrieve_directFunction · 0.85

Tested by

no test coverage detected