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

Function accumArrayResultAny

src/backend/utils/adt/arrayfuncs.c:5710–5729  ·  view source on GitHub ↗

* accumArrayResultAny - accumulate one (more) input for an array result * * astate is working state (can be NULL on first call) * dvalue/disnull represent the new input to append to the array * input_type is the input datatype (either element or array type) * rcontext is where to keep working state */

Source from the content-addressed store, hash-verified

5708 * rcontext is where to keep working state
5709 */
5710ArrayBuildStateAny *
5711accumArrayResultAny(ArrayBuildStateAny *astate,
5712 Datum dvalue, bool disnull,
5713 Oid input_type,
5714 MemoryContext rcontext)
5715{
5716 if (astate == NULL)
5717 astate = initArrayResultAny(input_type, rcontext, true);
5718
5719 if (astate->scalarstate)
5720 (void) accumArrayResult(astate->scalarstate,
5721 dvalue, disnull,
5722 input_type, rcontext);
5723 else
5724 (void) accumArrayResultArr(astate->arraystate,
5725 dvalue, disnull,
5726 input_type, rcontext);
5727
5728 return astate;
5729}
5730
5731/*
5732 * makeArrayResultAny - produce final result of accumArrayResultAny

Callers 2

ExecScanSubPlanFunction · 0.85
ExecSetParamPlanFunction · 0.85

Calls 3

initArrayResultAnyFunction · 0.85
accumArrayResultFunction · 0.85
accumArrayResultArrFunction · 0.85

Tested by

no test coverage detected