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

Function makeArrayResultAny

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

* makeArrayResultAny - produce final result of accumArrayResultAny * * astate is working state (must not be NULL) * rcontext is where to construct result * release is true if okay to release working state */

Source from the content-addressed store, hash-verified

5736 * release is true if okay to release working state
5737 */
5738Datum
5739makeArrayResultAny(ArrayBuildStateAny *astate,
5740 MemoryContext rcontext, bool release)
5741{
5742 Datum result;
5743
5744 if (astate->scalarstate)
5745 {
5746 /* Must use makeMdArrayResult to support "release" parameter */
5747 int ndims;
5748 int dims[1];
5749 int lbs[1];
5750
5751 /* If no elements were presented, we want to create an empty array */
5752 ndims = (astate->scalarstate->nelems > 0) ? 1 : 0;
5753 dims[0] = astate->scalarstate->nelems;
5754 lbs[0] = 1;
5755
5756 result = makeMdArrayResult(astate->scalarstate, ndims, dims, lbs,
5757 rcontext, release);
5758 }
5759 else
5760 {
5761 result = makeArrayResultArr(astate->arraystate,
5762 rcontext, release);
5763 }
5764 return result;
5765}
5766
5767
5768Datum

Callers 2

ExecScanSubPlanFunction · 0.85
ExecSetParamPlanFunction · 0.85

Calls 2

makeMdArrayResultFunction · 0.85
makeArrayResultArrFunction · 0.85

Tested by

no test coverage detected