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

Function DatumGetAnyArrayP

src/backend/utils/adt/array_expanded.c:400–417  ·  view source on GitHub ↗

* DatumGetAnyArrayP: return either an expanded array or a detoasted varlena * array. The result must not be modified in-place. */

Source from the content-addressed store, hash-verified

398 * array. The result must not be modified in-place.
399 */
400AnyArrayType *
401DatumGetAnyArrayP(Datum d)
402{
403 ExpandedArrayHeader *eah;
404
405 /*
406 * If it's an expanded array (RW or RO), return the header pointer.
407 */
408 if (VARATT_IS_EXTERNAL_EXPANDED(DatumGetPointer(d)))
409 {
410 eah = (ExpandedArrayHeader *) DatumGetEOHP(d);
411 Assert(eah->ea_magic == EA_MAGIC);
412 return (AnyArrayType *) eah;
413 }
414
415 /* Else do regular detoasting as needed */
416 return (AnyArrayType *) PG_DETOAST_DATUM(d);
417}
418
419/*
420 * Create the Datum/isnull representation of an expanded array object

Callers 1

array_mapFunction · 0.85

Calls 1

DatumGetEOHPFunction · 0.85

Tested by

no test coverage detected