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

Function array_agg_array_finalfn

src/backend/utils/adt/array_userfuncs.c:1144–1167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1142}
1143
1144Datum
1145array_agg_array_finalfn(PG_FUNCTION_ARGS)
1146{
1147 Datum result;
1148 ArrayBuildStateArr *state;
1149
1150 /* cannot be called directly because of internal-type argument */
1151 Assert(AggCheckCallContext(fcinfo, NULL));
1152
1153 state = PG_ARGISNULL(0) ? NULL : (ArrayBuildStateArr *) PG_GETARG_POINTER(0);
1154
1155 if (state == NULL)
1156 PG_RETURN_NULL(); /* returns null iff no input values */
1157
1158 /*
1159 * Make the result. We cannot release the ArrayBuildStateArr because
1160 * sometimes aggregate final functions are re-executed. Rather, it is
1161 * nodeAgg.c's responsibility to reset the aggcontext when it's safe to do
1162 * so.
1163 */
1164 result = makeArrayResultArr(state, CurrentMemoryContext, false);
1165
1166 PG_RETURN_DATUM(result);
1167}
1168
1169Datum
1170array_agg_array_combine(PG_FUNCTION_ARGS)

Callers

nothing calls this directly

Calls 2

AggCheckCallContextFunction · 0.85
makeArrayResultArrFunction · 0.85

Tested by

no test coverage detected