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

Function makeArrayResult

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

* makeArrayResult - produce 1-D final result of accumArrayResult * * Note: only releases astate if it was initialized within a separate memory * context (i.e. using subcontext=true when calling initArrayResultWithSize). * * astate is working state (must not be NULL) * rcontext is where to construct result */

Source from the content-addressed store, hash-verified

5301 * rcontext is where to construct result
5302 */
5303Datum
5304makeArrayResult(ArrayBuildState *astate,
5305 MemoryContext rcontext)
5306{
5307 int ndims;
5308 int dims[1];
5309 int lbs[1];
5310
5311 /* If no elements were presented, we want to create an empty array */
5312 ndims = (astate->nelems > 0) ? 1 : 0;
5313 dims[0] = astate->nelems;
5314 lbs[0] = 1;
5315
5316 return makeMdArrayResult(astate, ndims, dims, lbs, rcontext,
5317 astate->private_cxt);
5318}
5319
5320/*
5321 * makeMdArrayResult - produce multi-D final result of accumArrayResult

Callers 15

brin_revmap_chainFunction · 0.85
dblink_get_connectionsFunction · 0.85
serialize_expr_statsFunction · 0.85
xpathFunction · 0.85
regexp_split_to_arrayFunction · 0.85
array_positionsFunction · 0.85
text_to_arrayFunction · 0.85
parse_identFunction · 0.85
valueListToArrayFunction · 0.85

Calls 1

makeMdArrayResultFunction · 0.85

Tested by 1