| 149 | } |
| 150 | |
| 151 | ArrowArrayWrapper makeCsrNodeBatch(const std::vector<CsrNodeRow>& rows) { |
| 152 | std::vector<int64_t> ids; |
| 153 | std::vector<std::string> names; |
| 154 | std::vector<int64_t> scores; |
| 155 | std::vector<int32_t> regDates; |
| 156 | std::vector<std::vector<int64_t>> badges; |
| 157 | for (const auto& row : rows) { |
| 158 | ids.push_back(row.id); |
| 159 | names.emplace_back(row.name); |
| 160 | scores.push_back(row.score); |
| 161 | regDates.push_back(row.regDate); |
| 162 | badges.push_back(row.badges); |
| 163 | } |
| 164 | return createStructArray(static_cast<int64_t>(rows.size()), |
| 165 | {[&](ArrowArray* array) { createInt64Array(array, ids); }, |
| 166 | [&](ArrowArray* array) { createStringArray(array, names); }, |
| 167 | [&](ArrowArray* array) { createInt64Array(array, scores); }, |
| 168 | [&](ArrowArray* array) { createDateArray(array, regDates); }, |
| 169 | [&](ArrowArray* array) { createListInt64Array(array, badges); }}); |
| 170 | } |
| 171 | |
| 172 | ArrowArrayWrapper makeCsrEdgeBatch(const std::vector<CsrEdgeRow>& rows) { |
| 173 | std::vector<uint64_t> offsets; |
no test coverage detected