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

Function float8_datum_cast

methods/array_ops/src/pg_gp/array_ops.c:1223–1249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1221}
1222
1223static
1224inline
1225Datum
1226float8_datum_cast(float8 res, Oid result_type) {
1227 Datum result = Float8GetDatum(res);
1228 switch(result_type){
1229 case INT2OID:
1230 return DirectFunctionCall1(dtoi2, result); break;
1231 case INT4OID:
1232 return DirectFunctionCall1(dtoi4, result); break;
1233 case INT8OID:
1234 return DirectFunctionCall1(dtoi8, result); break;
1235 case FLOAT4OID:
1236 return DirectFunctionCall1(dtof, result); break;
1237 case FLOAT8OID:
1238 return result; break;
1239 case NUMERICOID:
1240 return DirectFunctionCall1(float8_numeric, result); break;
1241 default:
1242 ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1243 errmsg("type is not supported"),
1244 errdetail("Arrays with element type %s are not supported.",
1245 format_type_be(result_type))));
1246 break;
1247 }
1248 return result;
1249}
1250
1251/*
1252 * Template for element-wise help functions

Callers 8

array_sumFunction · 0.85
array_abs_sumFunction · 0.85
array_minFunction · 0.85
array_maxFunction · 0.85
array_absFunction · 0.85
array_cosFunction · 0.85
array_filterFunction · 0.85
element_opFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected