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

Function makeCsrNodeBatch

test/api/arrow_csr_rel_table_test.cpp:68–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68ArrowArrayWrapper makeCsrNodeBatch(const std::vector<CsrNodeRow>& rows) {
69 std::vector<int64_t> ids;
70 std::vector<std::string> names;
71 std::vector<int64_t> scores;
72 std::vector<int32_t> regDates;
73 std::vector<std::vector<int64_t>> badges;
74 for (const auto& row : rows) {
75 ids.push_back(row.id);
76 names.emplace_back(row.name);
77 scores.push_back(row.score);
78 regDates.push_back(row.regDate);
79 badges.push_back(row.badges);
80 }
81 return createStructArray(static_cast<int64_t>(rows.size()),
82 {[&](ArrowArray* array) { createInt64Array(array, ids); },
83 [&](ArrowArray* array) { createStringArray(array, names); },
84 [&](ArrowArray* array) { createInt64Array(array, scores); },
85 [&](ArrowArray* array) { createDateArray(array, regDates); },
86 [&](ArrowArray* array) { createListInt64Array(array, badges); }});
87}
88
89ArrowSchemaWrapper makeComplexFwdIndicesSchema() {
90 ArrowSchemaWrapper schema;

Callers 2

createGraphMethod · 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