| 66 | } |
| 67 | |
| 68 | ArrowArrayWrapper 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 | |
| 89 | ArrowSchemaWrapper makeComplexFwdIndicesSchema() { |
| 90 | ArrowSchemaWrapper schema; |
no test coverage detected