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

Function array_cum_sum

methods/array_ops/src/pg_gp/array_ops.c:902–911  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

900 */
901PG_FUNCTION_INFO_V1(array_cum_sum);
902Datum
903array_cum_sum(PG_FUNCTION_ARGS){
904 if (PG_ARGISNULL(0)) { PG_RETURN_NULL(); }
905
906 ArrayType *v = PG_GETARG_ARRAYTYPE_P(0);
907 ArrayType *res = General_Array_to_Cumulative_Array(v, Float8GetDatum(0.0), element_add);
908
909 PG_FREE_IF_COPY(v, 0);
910 PG_RETURN_ARRAYTYPE_P(res);
911}
912
913/*
914 * This function returns the cumulative product of the array elements.

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected