| 170 | } |
| 171 | |
| 172 | ArrowArrayWrapper 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 | |
| 193 | void createPersonTable(main::Connection& connection, const std::string& tableName = "person") { |
| 194 | std::vector<ArrowArrayWrapper> arrays; |
no test coverage detected