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

Function array_subscript_fetch

src/backend/utils/adt/arraysubs.c:235–254  ·  view source on GitHub ↗

* Evaluate SubscriptingRef fetch for an array element. * * Source container is in step's result variable (it's known not NULL, since * we set fetch_strict to true), and indexes have already been evaluated into * workspace array. */

Source from the content-addressed store, hash-verified

233 * workspace array.
234 */
235static void
236array_subscript_fetch(ExprState *state,
237 ExprEvalStep *op,
238 ExprContext *econtext)
239{
240 SubscriptingRefState *sbsrefstate = op->d.sbsref.state;
241 ArraySubWorkspace *workspace = (ArraySubWorkspace *) sbsrefstate->workspace;
242
243 /* Should not get here if source array (or any subscript) is null */
244 Assert(!(*op->resnull));
245
246 *op->resvalue = array_get_element(*op->resvalue,
247 sbsrefstate->numupper,
248 workspace->upperindex,
249 workspace->refattrlength,
250 workspace->refelemlength,
251 workspace->refelembyval,
252 workspace->refelemalign,
253 op->resnull);
254}
255
256/*
257 * Evaluate SubscriptingRef fetch for an array slice.

Callers

nothing calls this directly

Calls 1

array_get_elementFunction · 0.85

Tested by

no test coverage detected