| 515 | } |
| 516 | |
| 517 | Status MakeZeroLengthRecordBatch(std::shared_ptr<RecordBatch>* out) { |
| 518 | // Make the schema |
| 519 | auto f0 = field("f0", list(int32())); |
| 520 | auto f1 = field("f1", list(list(int32()))); |
| 521 | auto f2 = field("f2", int32()); |
| 522 | auto schema = ::arrow::schema({f0, f1, f2}); |
| 523 | |
| 524 | // Example data |
| 525 | MemoryPool* pool = default_memory_pool(); |
| 526 | const bool include_nulls = true; |
| 527 | std::shared_ptr<Array> leaf_values, list_array, list_list_array, flat_array; |
| 528 | RETURN_NOT_OK(MakeRandomInt32Array(0, include_nulls, pool, &leaf_values)); |
| 529 | RETURN_NOT_OK(MakeRandomListArray(leaf_values, 0, include_nulls, pool, &list_array)); |
| 530 | RETURN_NOT_OK( |
| 531 | MakeRandomListArray(list_array, 0, include_nulls, pool, &list_list_array)); |
| 532 | RETURN_NOT_OK(MakeRandomInt32Array(0, include_nulls, pool, &flat_array)); |
| 533 | *out = RecordBatch::Make(schema, 0, {list_array, list_list_array, flat_array}); |
| 534 | return Status::OK(); |
| 535 | } |
| 536 | |
| 537 | Status MakeNonNullRecordBatch(std::shared_ptr<RecordBatch>* out) { |
| 538 | // Make the schema |
no test coverage detected