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

Function makeSparseDataCopy

gpcontrib/gp_sparse_vector/SparseData.c:83–94  ·  view source on GitHub ↗

------------------------------------------------------------------------------ * Copy a SparseData structure including it's data and index */

Source from the content-addressed store, hash-verified

81 * Copy a SparseData structure including it's data and index
82 */
83SparseData makeSparseDataCopy(SparseData source_sdata)
84{
85 /* Allocate the struct */
86 SparseData sdata = (SparseData)palloc(sizeof(SparseDataStruct));
87 /* Allocate the included elements */
88 sdata->vals = copyStringInfo(source_sdata->vals);
89 sdata->index = copyStringInfo(source_sdata->index);
90 sdata->type_of_data = source_sdata->type_of_data;
91 sdata->unique_value_count = source_sdata->unique_value_count;
92 sdata->total_value_count = source_sdata->total_value_count;
93 return sdata;
94}
95/*
96 * Create a SparseData of size dimension from a constant
97 */

Callers 5

op_sdata_by_scalar_copyFunction · 0.85
pow_sdata_by_scalarFunction · 0.85
square_sdataFunction · 0.85
cube_sdataFunction · 0.85
quad_sdataFunction · 0.85

Calls 2

copyStringInfoFunction · 0.85
pallocFunction · 0.50

Tested by

no test coverage detected