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

Function svec_recv

gpcontrib/gp_sparse_vector/sparse_vector.c:104–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102 */
103PG_FUNCTION_INFO_V1(svec_recv);
104Datum
105svec_recv(PG_FUNCTION_ARGS)
106{
107 StringInfo buf = (StringInfo) PG_GETARG_POINTER(0);
108 SvecType *svec;
109
110 SparseData sdata=makeEmptySparseData();;
111 sdata->type_of_data = pq_getmsgint(buf, sizeof(int));
112 sdata->unique_value_count = pq_getmsgint(buf, sizeof(int));
113 sdata->total_value_count = pq_getmsgint(buf, sizeof(int));
114 sdata->vals->len = pq_getmsgint(buf, sizeof(int));
115 sdata->index->len = pq_getmsgint(buf, sizeof(int));
116 sdata->vals->data = (char *)pq_getmsgbytes(buf,sdata->vals->len);
117 sdata->index->data = (char *)pq_getmsgbytes(buf,sdata->index->len);
118 svec = svec_from_sparsedata(sdata,true); //Note that this copies the data
119// freeSparseDataAndData(sdata);
120 pfree(sdata);
121
122 PG_RETURN_SVECTYPE_P(svec);
123}
124
125/*
126 * Basic floating point operators like MIN,MAX

Callers

nothing calls this directly

Calls 5

makeEmptySparseDataFunction · 0.85
pq_getmsgintFunction · 0.85
pq_getmsgbytesFunction · 0.85
svec_from_sparsedataFunction · 0.85
pfreeFunction · 0.50

Tested by

no test coverage detected