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

Function array_subscript_fetch_slice

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

* Evaluate SubscriptingRef fetch for an array slice. * * 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

261 * workspace array.
262 */
263static void
264array_subscript_fetch_slice(ExprState *state,
265 ExprEvalStep *op,
266 ExprContext *econtext)
267{
268 SubscriptingRefState *sbsrefstate = op->d.sbsref.state;
269 ArraySubWorkspace *workspace = (ArraySubWorkspace *) sbsrefstate->workspace;
270
271 /* Should not get here if source array (or any subscript) is null */
272 Assert(!(*op->resnull));
273
274 *op->resvalue = array_get_slice(*op->resvalue,
275 sbsrefstate->numupper,
276 workspace->upperindex,
277 workspace->lowerindex,
278 sbsrefstate->upperprovided,
279 sbsrefstate->lowerprovided,
280 workspace->refattrlength,
281 workspace->refelemlength,
282 workspace->refelembyval,
283 workspace->refelemalign);
284 /* The slice is never NULL, so no need to change *op->resnull */
285}
286
287/*
288 * Evaluate SubscriptingRef assignment for an array element assignment.

Callers

nothing calls this directly

Calls 1

array_get_sliceFunction · 0.85

Tested by

no test coverage detected