MCPcopy Create free account
hub / github.com/apache/madlib / array_max

Function array_max

methods/array_ops/src/pg_gp/array_ops.c:539–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

537 */
538PG_FUNCTION_INFO_V1(array_max);
539Datum
540array_max(PG_FUNCTION_ARGS){
541 if (PG_ARGISNULL(0)) { PG_RETURN_NULL(); }
542
543 ArrayType *v = PG_GETARG_ARRAYTYPE_P(0);
544 Oid element_type = ARR_ELEMTYPE(v);
545
546 Datum res = General_Array_to_Element(v, Float8GetDatum(0), -get_float8_infinity(),
547 element_max, noop_finalize);
548
549 PG_FREE_IF_COPY(v, 0);
550
551 return float8_datum_cast(DatumGetFloat8(res), element_type);
552}
553
554typedef struct
555{

Callers

nothing calls this directly

Calls 2

General_Array_to_ElementFunction · 0.85
float8_datum_castFunction · 0.85

Tested by

no test coverage detected