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

Function datum_int64_cast

methods/array_ops/src/pg_gp/array_ops.c:1148–1167  ·  view source on GitHub ↗

----------------------------------------------------------------------- * Type cast functions * ----------------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

1146 * -----------------------------------------------------------------------
1147*/
1148static
1149inline
1150int64
1151datum_int64_cast(Datum elt, Oid element_type) {
1152 switch(element_type){
1153 case INT2OID:
1154 return (int64) DatumGetInt16(elt); break;
1155 case INT4OID:
1156 return (int64) DatumGetInt32(elt); break;
1157 case INT8OID:
1158 return elt; break;
1159 default:
1160 ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1161 errmsg("type is not supported"),
1162 errdetail("Arrays with element type %s are not supported.",
1163 format_type_be(element_type))));
1164 break;
1165 }
1166 return 0;
1167}
1168
1169static
1170inline

Callers 1

element_opFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected