| 36 | namespace arrow { |
| 37 | |
| 38 | std::shared_ptr<RecordBatch> MakeRecordBatch(int64_t total_size, int64_t num_fields) { |
| 39 | int64_t length = total_size / num_fields / sizeof(int64_t); |
| 40 | random::RandomArrayGenerator rand(0x4f32a908); |
| 41 | auto type = arrow::int64(); |
| 42 | |
| 43 | ArrayVector arrays; |
| 44 | std::vector<std::shared_ptr<Field>> fields; |
| 45 | for (int64_t i = 0; i < num_fields; ++i) { |
| 46 | std::stringstream ss; |
| 47 | ss << "f" << i; |
| 48 | fields.push_back(field(ss.str(), type)); |
| 49 | arrays.push_back(rand.Int64(length, 0, 100, 0.1)); |
| 50 | } |
| 51 | |
| 52 | auto schema = std::make_shared<Schema>(fields); |
| 53 | return RecordBatch::Make(schema, length, arrays); |
| 54 | } |
| 55 | |
| 56 | std::vector<int> GetIncludedFields(int64_t num_fields, int64_t is_partial_read) { |
| 57 | if (is_partial_read) { |
no test coverage detected