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

Function sdata_from_svec

gpcontrib/gp_sparse_vector/sparse_vector.h:82–97  ·  view source on GitHub ↗

* This routine supplies a pointer to a SparseData derived from an SvecType. * The SvecType is a serialized structure with fixed memory allocations, so * care must be taken not to append to the embedded StringInfo structs * without re-serializing the SparseData into the SvecType. */

Source from the content-addressed store, hash-verified

80 * without re-serializing the SparseData into the SvecType.
81 */
82static inline SparseData sdata_from_svec(SvecType *svec)
83{
84 char *sdataptr = SVEC_SDATAPTR(svec);
85 SparseData sdata = (SparseData)sdataptr;
86 sdata->vals = (StringInfo)SDATA_DATA_SINFO(sdataptr);
87 sdata->index = (StringInfo)SDATA_INDEX_SINFO(sdataptr);
88 sdata->vals->data = SVEC_VALS_PTR(svec);
89 if (sdata->index->maxlen == 0)
90 {
91 sdata->index->data = NULL;
92 } else
93 {
94 sdata->index->data = SVEC_INDEX_PTR(svec);
95 }
96 return(sdata);
97}
98
99char *svec_out_internal(SvecType *svec);
100SvecType *svec_from_sparsedata(SparseData sdata,bool trim);

Callers 15

svec_sendFunction · 0.85
svec_out_internalFunction · 0.85
reallocSvecFunction · 0.85
svec_unnestFunction · 0.85
svec_concat_replicateFunction · 0.85
svec_concatFunction · 0.85
svec_eqFunction · 0.85
svec_l2_cmp_internalFunction · 0.85
op_svec_by_svec_internalFunction · 0.85
svec_countFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected