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

Function AnyTable_GetNextTuple

src/backend/executor/nodeTableFunction.c:499–530  ·  view source on GitHub ↗

* Get the next tuple from anytable * * will alloc memory in caller's memory context. * caller need to release the memory using pfree() */

Source from the content-addressed store, hash-verified

497 * caller need to release the memory using pfree()
498 */
499HeapTuple
500AnyTable_GetNextTuple(AnyTable t)
501{
502 MemoryContext oldcontext;
503 TupleTableSlot *slot;
504
505 if (t == NULL)
506 {
507 ereport(ERROR,
508 (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
509 errmsg("invalid null value for anytable type")));
510 }
511
512 /* Fetch the next tuple into the tuple slot */
513 oldcontext = MemoryContextSwitchTo(t->econtext->ecxt_per_query_memory);
514 t->econtext->ecxt_outertuple = ExecProcNode(t->subplan);
515 MemoryContextSwitchTo(oldcontext);
516 if (TupIsNull(t->econtext->ecxt_outertuple))
517 {
518 return (HeapTuple) NULL;
519 }
520
521 /* ----------------------------------------
522 * 1) Fetch the tuple from the tuple slot
523 * 2) apply resjunk filtering
524 * 3) copy result into a HeapTuple
525 * ----------------------------------------
526 */
527
528 slot = ExecFilterJunk(t->junkfilter, t->econtext->ecxt_outertuple);
529 return ExecCopySlotHeapTuple(slot);
530}
531
532/*
533 * tf_set_userdata_internal

Callers 7

multiset_scalar_valueFunction · 0.85
multiset_exampleFunction · 0.85
noop_projectFunction · 0.85
sessionizeFunction · 0.85
projectFunction · 0.85
userdata_projectFunction · 0.85
GppcAnyTableGetNextTupleFunction · 0.85

Calls 6

MemoryContextSwitchToFunction · 0.85
ExecProcNodeFunction · 0.85
ExecFilterJunkFunction · 0.85
ExecCopySlotHeapTupleFunction · 0.85
errcodeFunction · 0.50
errmsgFunction · 0.50

Tested by 6

multiset_scalar_valueFunction · 0.68
multiset_exampleFunction · 0.68
noop_projectFunction · 0.68
sessionizeFunction · 0.68
projectFunction · 0.68
userdata_projectFunction · 0.68