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

Function array_min

methods/array_ops/src/pg_gp/array_ops.c:521–533  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

519 */
520PG_FUNCTION_INFO_V1(array_min);
521Datum
522array_min(PG_FUNCTION_ARGS){
523 if (PG_ARGISNULL(0)) { PG_RETURN_NULL(); }
524
525 ArrayType *v = PG_GETARG_ARRAYTYPE_P(0);
526 Oid element_type = ARR_ELEMTYPE(v);
527 Datum res = General_Array_to_Element(v, Float8GetDatum(0), get_float8_infinity(),
528 element_min, noop_finalize);
529
530 PG_FREE_IF_COPY(v, 0);
531
532 return float8_datum_cast(DatumGetFloat8(res), element_type);
533}
534
535/*
536 * This function returns maximum of the array elements.

Callers

nothing calls this directly

Calls 2

General_Array_to_ElementFunction · 0.85
float8_datum_castFunction · 0.85

Tested by

no test coverage detected