| 51 | }; |
| 52 | |
| 53 | ArrowArrayWrapper makeUserBatch(const std::vector<UserRow>& rows) { |
| 54 | std::vector<int64_t> ids; |
| 55 | std::vector<std::string> names; |
| 56 | std::vector<int64_t> ages; |
| 57 | std::vector<int32_t> joinDates; |
| 58 | std::vector<std::vector<int64_t>> tags; |
| 59 | for (const auto& row : rows) { |
| 60 | ids.push_back(row.id); |
| 61 | names.emplace_back(row.name); |
| 62 | ages.push_back(row.age); |
| 63 | joinDates.push_back(row.joinDate); |
| 64 | tags.push_back(row.tags); |
| 65 | } |
| 66 | return createStructArray(static_cast<int64_t>(rows.size()), |
| 67 | {[&](ArrowArray* array) { createInt64Array(array, ids); }, |
| 68 | [&](ArrowArray* array) { createStringArray(array, names); }, |
| 69 | [&](ArrowArray* array) { createInt64Array(array, ages); }, |
| 70 | [&](ArrowArray* array) { createDateArray(array, joinDates); }, |
| 71 | [&](ArrowArray* array) { createListInt64Array(array, tags); }}); |
| 72 | } |
| 73 | |
| 74 | ArrowArrayWrapper makeCityBatch(const std::vector<CityRow>& rows) { |
| 75 | std::vector<int64_t> ids; |
no test coverage detected