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

Function array_mean

methods/array_ops/src/pg_gp/array_ops.c:445–457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

443 */
444PG_FUNCTION_INFO_V1(array_mean);
445Datum
446array_mean(PG_FUNCTION_ARGS){
447 if (PG_ARGISNULL(0)) { PG_RETURN_NULL(); }
448
449 ArrayType *v = PG_GETARG_ARRAYTYPE_P(0);
450
451 Datum res = General_Array_to_Element(v, Float8GetDatum(0), 0.0,
452 element_sum, average_finalize);
453
454 PG_FREE_IF_COPY(v, 0);
455
456 return(res);
457}
458
459/*
460 * This function returns sum of the array elements, typed float8.

Callers

nothing calls this directly

Calls 1

General_Array_to_ElementFunction · 0.85

Tested by

no test coverage detected