MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / makeCsrNodeBatch

Function makeCsrNodeBatch

test/api/arrow_drop_table_test.cpp:151–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151ArrowArrayWrapper makeCsrNodeBatch(const std::vector<CsrNodeRow>& rows) {
152 std::vector<int64_t> ids;
153 std::vector<std::string> names;
154 std::vector<int64_t> scores;
155 std::vector<int32_t> regDates;
156 std::vector<std::vector<int64_t>> badges;
157 for (const auto& row : rows) {
158 ids.push_back(row.id);
159 names.emplace_back(row.name);
160 scores.push_back(row.score);
161 regDates.push_back(row.regDate);
162 badges.push_back(row.badges);
163 }
164 return createStructArray(static_cast<int64_t>(rows.size()),
165 {[&](ArrowArray* array) { createInt64Array(array, ids); },
166 [&](ArrowArray* array) { createStringArray(array, names); },
167 [&](ArrowArray* array) { createInt64Array(array, scores); },
168 [&](ArrowArray* array) { createDateArray(array, regDates); },
169 [&](ArrowArray* array) { createListInt64Array(array, badges); }});
170}
171
172ArrowArrayWrapper makeCsrEdgeBatch(const std::vector<CsrEdgeRow>& rows) {
173 std::vector<uint64_t> offsets;

Callers 1

createCsrNodeTableFunction · 0.70

Calls 8

createStructArrayFunction · 0.85
createInt64ArrayFunction · 0.85
createStringArrayFunction · 0.85
createDateArrayFunction · 0.85
createListInt64ArrayFunction · 0.85
emplace_backMethod · 0.80
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected