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

Function makeSparseData

gpcontrib/gp_sparse_vector/SparseData.c:33–48  ·  view source on GitHub ↗

------------------------------------------------------------------------------ * Create a SparseData structure * * There are ways to do this: * First way allocates empty dynamic StringInfo of unknown initial sizes * Second way creates a copy of an existing SparseData * Third way creates a SparseData with zero storage in it's StringInfos * Fourth way creates a SparseData in place using p

Source from the content-addressed store, hash-verified

31 * index data
32 */
33SparseData makeSparseData(void)
34{
35 /* Allocate the struct */
36 SparseData sdata = (SparseData)palloc(sizeof(SparseDataStruct));
37 /* Allocate the included elements */
38 sdata->vals = makeStringInfo();
39 sdata->index = makeStringInfo();
40 sdata->vals->len = 0;
41 sdata->index->len = 0;
42 sdata->vals->cursor = 0;
43 sdata->index->cursor = 0;
44 sdata->unique_value_count=0;
45 sdata->total_value_count=0;
46 sdata->type_of_data = FLOAT8OID;
47 return sdata;
48}
49SparseData makeEmptySparseData(void)
50{
51 /* Allocate the struct */

Callers 4

makeEmptySparseDataFunction · 0.85
float8arr_to_sdataFunction · 0.85
arr_to_sdataFunction · 0.85
op_sdata_by_sdataFunction · 0.85

Calls 2

makeStringInfoFunction · 0.85
pallocFunction · 0.50

Tested by

no test coverage detected