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

Function numeric_accum

src/backend/utils/adt/numeric.c:4829–4844  ·  view source on GitHub ↗

* Generic transition function for numeric aggregates that require sumX2. */

Source from the content-addressed store, hash-verified

4827 * Generic transition function for numeric aggregates that require sumX2.
4828 */
4829Datum
4830numeric_accum(PG_FUNCTION_ARGS)
4831{
4832 NumericAggState *state;
4833
4834 state = PG_ARGISNULL(0) ? NULL : (NumericAggState *) PG_GETARG_POINTER(0);
4835
4836 /* Create the state data on the first call */
4837 if (state == NULL)
4838 state = makeNumericAggState(fcinfo, true);
4839
4840 if (!PG_ARGISNULL(1))
4841 do_numeric_accum(state, PG_GETARG_NUMERIC(1));
4842
4843 PG_RETURN_POINTER(state);
4844}
4845
4846/*
4847 * Generic combine function for numeric aggregates which require sumX2

Callers

nothing calls this directly

Calls 2

makeNumericAggStateFunction · 0.85
do_numeric_accumFunction · 0.85

Tested by

no test coverage detected