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

Function makeCsrEdgeBatch

test/api/arrow_drop_table_test.cpp:172–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172ArrowArrayWrapper makeCsrEdgeBatch(const std::vector<CsrEdgeRow>& rows) {
173 std::vector<uint64_t> offsets;
174 std::vector<int64_t> weights;
175 std::vector<std::string> labels;
176 std::vector<int32_t> since;
177 std::vector<std::vector<int64_t>> hops;
178 for (const auto& row : rows) {
179 offsets.push_back(row.offset);
180 weights.push_back(row.weight);
181 labels.emplace_back(row.label);
182 since.push_back(row.since);
183 hops.push_back(row.hops);
184 }
185 return createStructArray(static_cast<int64_t>(rows.size()),
186 {[&](ArrowArray* array) { createUint64Array(array, offsets); },
187 [&](ArrowArray* array) { createInt64Array(array, weights); },
188 [&](ArrowArray* array) { createStringArray(array, labels); },
189 [&](ArrowArray* array) { createDateArray(array, since); },
190 [&](ArrowArray* array) { createListInt64Array(array, hops); }});
191}
192
193void createPersonTable(main::Connection& connection, const std::string& tableName = "person") {
194 std::vector<ArrowArrayWrapper> arrays;

Callers 1

createCsrRelTableFunction · 0.70

Calls 9

createStructArrayFunction · 0.85
createUint64ArrayFunction · 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