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

Function makeCityBatch

test/api/arrow_rel_table_test.cpp:169–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169ArrowArrayWrapper makeCityBatch(const std::vector<CityRow>& rows) {
170 std::vector<int64_t> ids;
171 std::vector<std::string> names;
172 std::vector<int64_t> populations;
173 std::vector<int32_t> founded;
174 std::vector<std::vector<int64_t>> tags;
175 for (const auto& row : rows) {
176 ids.push_back(row.id);
177 names.emplace_back(row.name);
178 populations.push_back(row.population);
179 founded.push_back(row.founded);
180 tags.push_back(row.tags);
181 }
182 return createStructArray(static_cast<int64_t>(rows.size()),
183 {[&](ArrowArray* array) { createInt64Array(array, ids); },
184 [&](ArrowArray* array) { createStringArray(array, names); },
185 [&](ArrowArray* array) { createInt64Array(array, populations); },
186 [&](ArrowArray* array) { createDateArray(array, founded); },
187 [&](ArrowArray* array) { createListInt64Array(array, tags); }});
188}
189
190ArrowArrayWrapper makeKnowsBatch(const std::vector<KnowsRow>& rows) {
191 std::vector<int64_t> from;

Callers 1

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