| 280 | } |
| 281 | |
| 282 | Status MakeIntBatchSized(int length, std::shared_ptr<RecordBatch>* out, uint32_t seed) { |
| 283 | // Make the schema |
| 284 | auto f0 = field("f0", int8()); |
| 285 | auto f1 = field("f1", uint8()); |
| 286 | auto f2 = field("f2", int16()); |
| 287 | auto f3 = field("f3", uint16()); |
| 288 | auto f4 = field("f4", int32()); |
| 289 | auto f5 = field("f5", uint32()); |
| 290 | auto f6 = field("f6", int64()); |
| 291 | auto f7 = field("f7", uint64()); |
| 292 | auto schema = ::arrow::schema({f0, f1, f2, f3, f4, f5, f6, f7}); |
| 293 | |
| 294 | // Example data |
| 295 | std::shared_ptr<Array> a0, a1, a2, a3, a4, a5, a6, a7; |
| 296 | MemoryPool* pool = default_memory_pool(); |
| 297 | RETURN_NOT_OK(MakeRandomArray<Int8Type>(length, false, pool, &a0, seed)); |
| 298 | RETURN_NOT_OK(MakeRandomArray<UInt8Type>(length, true, pool, &a1, seed)); |
| 299 | RETURN_NOT_OK(MakeRandomArray<Int16Type>(length, true, pool, &a2, seed)); |
| 300 | RETURN_NOT_OK(MakeRandomArray<UInt16Type>(length, false, pool, &a3, seed)); |
| 301 | RETURN_NOT_OK(MakeRandomArray<Int32Type>(length, false, pool, &a4, seed)); |
| 302 | RETURN_NOT_OK(MakeRandomArray<UInt32Type>(length, true, pool, &a5, seed)); |
| 303 | RETURN_NOT_OK(MakeRandomArray<Int64Type>(length, true, pool, &a6, seed)); |
| 304 | RETURN_NOT_OK(MakeRandomArray<UInt64Type>(length, false, pool, &a7, seed)); |
| 305 | *out = RecordBatch::Make(schema, length, {a0, a1, a2, a3, a4, a5, a6, a7}); |
| 306 | return Status::OK(); |
| 307 | } |
| 308 | |
| 309 | Status MakeIntRecordBatch(std::shared_ptr<RecordBatch>* out) { |
| 310 | return MakeIntBatchSized(10, out); |
no test coverage detected