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

Function svec_append

methods/svec_util/src/pg_gp/svec_util.c:221–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219Datum svec_append(PG_FUNCTION_ARGS);
220PG_FUNCTION_INFO_V1(svec_append);
221Datum svec_append(PG_FUNCTION_ARGS)
222{
223 float8 newele;
224 int64 run_len;
225 SvecType *svec;
226 SparseData sdata;
227
228 if (PG_ARGISNULL(2))
229 ereport(ERROR,
230 (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
231 errmsg("count argument cannot be null")));
232
233 run_len = PG_GETARG_INT64(2);
234
235 if (PG_ARGISNULL(1))
236 newele = NVP;
237 else newele = PG_GETARG_FLOAT8(1);
238
239 if (PG_ARGISNULL(0))
240 sdata = makeSparseData();
241 else {
242 svec = PG_GETARG_SVECTYPE_P(0);
243 sdata = makeSparseDataCopy(sdata_from_svec(svec));
244 }
245
246 add_run_to_sdata((char *)(&newele), run_len, sizeof(float8), sdata);
247 PG_RETURN_SVECTYPE_P(svec_from_sparsedata(sdata, true));
248}
249
250
251/**

Callers

nothing calls this directly

Calls 5

makeSparseDataFunction · 0.85
makeSparseDataCopyFunction · 0.85
sdata_from_svecFunction · 0.85
add_run_to_sdataFunction · 0.85
svec_from_sparsedataFunction · 0.85

Tested by

no test coverage detected