| 167 | } |
| 168 | |
| 169 | ArrowArrayWrapper 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 | |
| 190 | ArrowArrayWrapper makeKnowsBatch(const std::vector<KnowsRow>& rows) { |
| 191 | std::vector<int64_t> from; |
no test coverage detected