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

Function fetch_input_tuple

src/backend/executor/nodeAgg.c:583–604  ·  view source on GitHub ↗

* Fetch a tuple from either the outer plan (for phase 1) or from the sorter * populated by the previous phase. Copy it to the sorter for the next phase * if any. * * Callers cannot rely on memory for tuple in returned slot remaining valid * past any subsequently fetched tuple. */

Source from the content-addressed store, hash-verified

581 * past any subsequently fetched tuple.
582 */
583static TupleTableSlot *
584fetch_input_tuple(AggState *aggstate)
585{
586 TupleTableSlot *slot;
587
588 if (aggstate->sort_in)
589 {
590 /* make sure we check for interrupts in either path through here */
591 CHECK_FOR_INTERRUPTS();
592 if (!tuplesort_gettupleslot(aggstate->sort_in, true, false,
593 aggstate->sort_slot, NULL))
594 return NULL;
595 slot = aggstate->sort_slot;
596 }
597 else
598 slot = ExecProcNode(outerPlanState(aggstate));
599
600 if (!TupIsNull(slot) && aggstate->sort_out)
601 tuplesort_puttupleslot(aggstate->sort_out, slot);
602
603 return slot;
604}
605
606/*
607 * (Re)Initialize an individual aggregate.

Callers 2

agg_retrieve_directFunction · 0.85
agg_fill_hash_tableFunction · 0.85

Calls 3

tuplesort_gettupleslotFunction · 0.85
ExecProcNodeFunction · 0.85
tuplesort_puttupleslotFunction · 0.85

Tested by

no test coverage detected