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

Function average_finalize

methods/array_ops/src/pg_gp/array_ops.c:1087–1097  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1085}
1086
1087static
1088inline
1089Datum
1090average_finalize(Datum elt,int size,Oid element_type){
1091 float8 value = datum_float8_cast(elt, element_type);
1092 if (size == 0) {
1093 elog(WARNING, "Input array only contains NULL or NaN, returning 0");
1094 return Float8GetDatum(0);
1095 }
1096 return Float8GetDatum(value/(float8)size);
1097}
1098
1099static
1100inline

Callers

nothing calls this directly

Calls 1

datum_float8_castFunction · 0.85

Tested by

no test coverage detected